jMailer
extends PHPMailer
in package
jMailer based on PHPMailer - PHP email transport class.
Tags
Table of Contents
- DEBUG_RECEIVER_CONFIG = 1
- DEBUG_RECEIVER_USER = 2
- $filePath : mixed
- the path of the directory where to store mails if mailer is file.
- $bodyTpl : string
- the selector of the template used for the mail.
- $copyToFiles : mixed
- indicates if mails should be copied into files, so the developer can verify that all mails are sent.
- $debugBodyIntroduction : mixed
- $debugFrom : string
- $debugFromName : string
- $debugModeEnabled : bool
- Debug mode.
- $debugOriginalValues : mixed
- $debugReceivers : array<string|int, mixed>
- List of addresses to send all emails. Addresses in "To".
- $debugReceiversEnabled : bool
- Debug mode for receivers. If activated, debugReceivers should be filled.
- $debugReceiversType : int
- $debugReceiversWhiteList : array<string|int, mixed>
- List of valid addresses.
- $debugSubjectPrefix : mixed
- $defaultLang : mixed
- $html2textConverter : mixed
- $htmlImageBaseDir : mixed
- $tpl : mixed
- __construct() : mixed
- initialize some member.
- createHeader() : mixed
- debugOutputCallback() : mixed
- getAddrName() : array<string|int, mixed>
- Find the name and address in the form "name<address@hop.tld>".
- html2textKeepLinkSafe() : string
- Convert HTML content to Text.
- IsFile() : mixed
- Sets Mailer to store message into files instead of sending it useful for tests.
- send() : bool
- Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
- setLanguage() : mixed
- Tpl() : jTpl
- Adds a Tpl référence.
- copyMail() : mixed
- debugOverrideReceivers() : mixed
- FileSend() : bool
- store mail in file instead of sending it.
- getStorageFile() : mixed
- getUserIp() : mixed
- lang() : mixed
- mailSend() : mixed
- sendmailSend() : mixed
- setError() : mixed
- smtpSend() : mixed
Constants
DEBUG_RECEIVER_CONFIG
public
mixed
DEBUG_RECEIVER_CONFIG
= 1
Tags
DEBUG_RECEIVER_USER
public
mixed
DEBUG_RECEIVER_USER
= 2
Tags
Properties
$filePath
the path of the directory where to store mails if mailer is file.
public
mixed
$filePath
= ''
Tags
$bodyTpl
the selector of the template used for the mail.
protected
string
$bodyTpl
= ''
Use the Tpl() method to change this property.
Tags
$copyToFiles
indicates if mails should be copied into files, so the developer can verify that all mails are sent.
protected
mixed
$copyToFiles
= \false
Tags
$debugBodyIntroduction
protected
mixed
$debugBodyIntroduction
= 'This is an example of a message that could be send with following parameters, in the normal mode:'
Tags
$debugFrom
protected
string
$debugFrom
= ''
replacement for the From header
Tags
$debugFromName
protected
string
$debugFromName
= ''
replacement for the From header
Tags
$debugModeEnabled
Debug mode.
protected
bool
$debugModeEnabled
= \false
Tags
$debugOriginalValues
protected
mixed
$debugOriginalValues
= array()
Tags
$debugReceivers
List of addresses to send all emails. Addresses in "To".
protected
array<string|int, mixed>
$debugReceivers
= array()
Tags
$debugReceiversEnabled
Debug mode for receivers. If activated, debugReceivers should be filled.
protected
bool
$debugReceiversEnabled
= \false
Tags
$debugReceiversType
protected
int
$debugReceiversType
= 1
combination of DEBUG_RECEIVER_*
Tags
$debugReceiversWhiteList
List of valid addresses.
protected
array<string|int, mixed>
$debugReceiversWhiteList
= array()
Receivers for 'To' having these emails will not be replaced by debugReceivers Receivers for 'Cc' and 'Bcc' having these emails will not be removed
Tags
$debugSubjectPrefix
protected
mixed
$debugSubjectPrefix
= '[DEBUG MODE]'
Tags
$defaultLang
protected
mixed
$defaultLang
Tags
$html2textConverter
protected
mixed
$html2textConverter
= \false
Tags
$htmlImageBaseDir
protected
mixed
$htmlImageBaseDir
= ''
Tags
$tpl
protected
mixed
$tpl
Tags
Methods
__construct()
initialize some member.
public
__construct() : mixed
Tags
Return values
mixed —createHeader()
public
createHeader() : mixed
Tags
Return values
mixed —debugOutputCallback()
public
debugOutputCallback(mixed $msg, mixed $smtpDebugLevel) : mixed
Parameters
- $msg : mixed
- $smtpDebugLevel : mixed
Tags
Return values
mixed —getAddrName()
Find the name and address in the form "name<address@hop.tld>".
public
getAddrName(string $address[, string $kind = false ]) : array<string|int, mixed>
Parameters
- $address : string
- $kind : string = false
-
One of 'to', 'cc', 'bcc', or 'ReplyTo'
Tags
Return values
array<string|int, mixed> —contains $name, $address
html2textKeepLinkSafe()
Convert HTML content to Text.
public
html2textKeepLinkSafe(string $html) : string
Basically, it removes all tags (strip_tags). For tags, it puts the link in parenthesis, except elements having the "notexpandlink". class.
Parameters
- $html : string
Tags
Return values
string —IsFile()
Sets Mailer to store message into files instead of sending it useful for tests.
public
IsFile() : mixed
Tags
Return values
mixed —send()
Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
public
send() : bool
Tags
Return values
bool —setLanguage()
public
setLanguage([mixed $lang_type = 'en' ][, mixed $lang_path = 'language/' ]) : mixed
Parameters
- $lang_type : mixed = 'en'
- $lang_path : mixed = 'language/'
Tags
Return values
mixed —Tpl()
Adds a Tpl référence.
public
Tpl(string $selector[, bool $isHtml = false ][, mixed $html2textConverter = false ][, mixed $htmlImageBaseDir = '' ]) : jTpl
Parameters
- $selector : string
- $isHtml : bool = false
-
true if the content of the template is html. IsHTML() is called.
- $html2textConverter : mixed = false
- $htmlImageBaseDir : mixed = ''
Tags
Return values
jTpl —the template object
copyMail()
protected
copyMail(mixed $header, mixed $body) : mixed
Parameters
- $header : mixed
- $body : mixed
Tags
Return values
mixed —debugOverrideReceivers()
protected
debugOverrideReceivers() : mixed
Tags
Return values
mixed —FileSend()
store mail in file instead of sending it.
protected
FileSend(mixed $header, mixed $body) : bool
Parameters
- $header : mixed
- $body : mixed
Tags
Return values
bool —getStorageFile()
protected
getStorageFile() : mixed
Tags
Return values
mixed —getUserIp()
protected
getUserIp() : mixed
Tags
Return values
mixed —lang()
protected
lang(mixed $key) : mixed
Parameters
- $key : mixed
Tags
Return values
mixed —mailSend()
protected
mailSend(mixed $header, mixed $body) : mixed
Parameters
- $header : mixed
- $body : mixed
Tags
Return values
mixed —sendmailSend()
protected
sendmailSend(mixed $header, mixed $body) : mixed
Parameters
- $header : mixed
- $body : mixed
Tags
Return values
mixed —setError()
protected
setError(mixed $msg) : mixed
Parameters
- $msg : mixed
Tags
Return values
mixed —smtpSend()
protected
smtpSend(mixed $header, mixed $body) : mixed
Parameters
- $header : mixed
- $body : mixed