Bitrix API

Mail

Table of Contents

Methods

__construct()  : mixed
Mail constructor.
canSend()  : bool
Return true if mail can be sent.
createInstance()  : static
Create instance.
dump()  : string
Dump email data.
encodeHeaderFrom()  : string
Encode header From.
encodeMimeString()  : string
Encode mime string.
encodeSubject()  : string
Encode subject.
getAdditionalParameters()  : mixed
Get additional parameters.
getBody()  : string
Get body.
getContext()  : Context|null
Get context instance.
getHeaders()  : string
Get headers.
getMailEol()  : string
Get symbol of mail End-Of-Line.
getMessageId()  : string
Get message ID.
getSubject()  : string
Get subject.
getTo()  : string
Get to.
hasAttachment()  : bool
Return true if mail has attachment.
hasImageAttachment()  : bool
Return true if mail has image attachment.
initSettings()  : void
Init settings.
is8Bit()  : bool
Return true if input string is in 8bit charset.
replaceHrefs()  : mixed
Replace href attribute in links.
replaceImages()  : string
Replace images.
send()  : bool
Send email.
setAdditionalParameters()  : void
Set additional parameters.
setAttachment()  : void
Set attachment.
setBody()  : void
Set body.
setHeaders()  : $this
Set headers.
setSubject()  : $this
Set subject.
setTo()  : $this
Set to.
toPunycode()  : string
Converts an international domain in the email to Punycode.
trackClick()  : string
Track click.

Methods

__construct()

Mail constructor.

public __construct(array<string|int, mixed> $mailParams) : mixed
Parameters
$mailParams : array<string|int, mixed>

Mail parameters.

canSend()

Return true if mail can be sent.

public canSend() : bool
Return values
bool

createInstance()

Create instance.

public static createInstance(array<string|int, mixed> $mailParams) : static
Parameters
$mailParams : array<string|int, mixed>

Mail parameters.

Return values
static

dump()

Dump email data.

public dump() : string
Return values
string

encodeHeaderFrom()

Encode header From.

public static encodeHeaderFrom(string $text, string $charset) : string
Parameters
$text : string

Text string.

$charset : string

Charset.

Return values
string

encodeMimeString()

Encode mime string.

public static encodeMimeString(string $text, string $charset) : string
Parameters
$text : string

Text string.

$charset : string

Charset.

Return values
string

encodeSubject()

Encode subject.

public static encodeSubject(string $text, string $charset) : string
Parameters
$text : string

Text string.

$charset : string

Charset.

Return values
string

getAdditionalParameters()

Get additional parameters.

public getAdditionalParameters() : mixed

getBody()

Get body.

public getBody() : string
Return values
string

getContext()

Get context instance.

public getContext() : Context|null
Return values
Context|null

getHeaders()

Get headers.

public getHeaders() : string
Return values
string

getMailEol()

Get symbol of mail End-Of-Line.

public static getMailEol() : string
Return values
string

getMessageId()

Get message ID.

public getMessageId() : string
Return values
string

getSubject()

Get subject.

public getSubject() : string
Return values
string

getTo()

Get to.

public getTo() : string
Return values
string

hasAttachment()

Return true if mail has attachment.

public hasAttachment() : bool
Return values
bool

hasImageAttachment()

Return true if mail has image attachment.

public hasImageAttachment([bool $checkRelated = false ]) : bool
Parameters
$checkRelated : bool = false

Check image as related.

Return values
bool

initSettings()

Init settings.

public initSettings() : void

is8Bit()

Return true if input string is in 8bit charset.

public static is8Bit(string $inputString) : bool
Parameters
$inputString : string

Input string.

Return values
bool

replaceHrefs()

Replace href attribute in links.

public replaceHrefs(string $text) : mixed

All href of links in html will be added by protocol and domain.

Parameters
$text : string

Text.

replaceImages()

Replace images.

public replaceImages(string $text) : string

All src of images in html will be added by protocol and domain.

Parameters
$text : string

Html text.

Return values
string

send()

Send email.

public static send(array<string|int, mixed> $mailParams) : bool
Parameters
$mailParams : array<string|int, mixed>

Mail parameters.

Return values
bool

setAdditionalParameters()

Set additional parameters.

public setAdditionalParameters([string $additionalParameters = '' ]) : void
Parameters
$additionalParameters : string = ''

Additional parameters.

setAttachment()

Set attachment.

public setAttachment() : void

setBody()

Set body.

public setBody(string $bodyPart) : void
Parameters
$bodyPart : string

Html or text of body.

setHeaders()

Set headers.

public setHeaders(array<string|int, mixed> $headers) : $this
Parameters
$headers : array<string|int, mixed>

Headers.

Return values
$this

setSubject()

Set subject.

public setSubject(string $subject) : $this
Parameters
$subject : string

Subject.

Return values
$this

setTo()

Set to.

public setTo(string $to) : $this
Parameters
$to : string

To.

Return values
$this

toPunycode()

Converts an international domain in the email to Punycode.

public static toPunycode(string $to) : string
Parameters
$to : string

Email address, possibly with a comment

Return values
string

trackClick()

Track click.

public trackClick(array<string|int, mixed> $matches) : string

All href of links in html will be wrapped by tracking url for click-detecting.

Parameters
$matches : array<string|int, mixed>

Result of preg_match call.

Return values
string

        
On this page

Search results