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
boolcreateInstance()
Create instance.
public
static createInstance(array<string|int, mixed> $mailParams) : static
Parameters
- $mailParams : array<string|int, mixed>
-
Mail parameters.
Return values
staticdump()
Dump email data.
public
dump() : string
Return values
stringencodeHeaderFrom()
Encode header From.
public
static encodeHeaderFrom(string $text, string $charset) : string
Parameters
- $text : string
-
Text string.
- $charset : string
-
Charset.
Return values
stringencodeMimeString()
Encode mime string.
public
static encodeMimeString(string $text, string $charset) : string
Parameters
- $text : string
-
Text string.
- $charset : string
-
Charset.
Return values
stringencodeSubject()
Encode subject.
public
static encodeSubject(string $text, string $charset) : string
Parameters
- $text : string
-
Text string.
- $charset : string
-
Charset.
Return values
stringgetAdditionalParameters()
Get additional parameters.
public
getAdditionalParameters() : mixed
getBody()
Get body.
public
getBody() : string
Return values
stringgetContext()
Get context instance.
public
getContext() : Context|null
Return values
Context|nullgetHeaders()
Get headers.
public
getHeaders() : string
Return values
stringgetMailEol()
Get symbol of mail End-Of-Line.
public
static getMailEol() : string
Return values
stringgetMessageId()
Get message ID.
public
getMessageId() : string
Return values
stringgetSubject()
Get subject.
public
getSubject() : string
Return values
stringgetTo()
Get to.
public
getTo() : string
Return values
stringhasAttachment()
Return true if mail has attachment.
public
hasAttachment() : bool
Return values
boolhasImageAttachment()
Return true if mail has image attachment.
public
hasImageAttachment([bool $checkRelated = false ]) : bool
Parameters
- $checkRelated : bool = false
-
Check image as related.
Return values
boolinitSettings()
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
boolreplaceHrefs()
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
stringsend()
Send email.
public
static send(array<string|int, mixed> $mailParams) : bool
Parameters
- $mailParams : array<string|int, mixed>
-
Mail parameters.
Return values
boolsetAdditionalParameters()
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
$thissetSubject()
Set subject.
public
setSubject(string $subject) : $this
Parameters
- $subject : string
-
Subject.
Return values
$thissetTo()
Set to.
public
setTo(string $to) : $this
Parameters
- $to : string
-
To.
Return values
$thistoPunycode()
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
stringtrackClick()
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.