Test the format of an email address, according to RFC 2822 and 2821
static
boolean
testEmailAddress
(string $address, [ $rfc_allowed_length = true], [ $rfc_allowed_characters = true])
-
string
$address
-
$rfc_allowed_length
-
$rfc_allowed_characters
Constructor
mSmtp
__construct
( $sender, $smtp_address, [ $smtp_port = 25])
-
$sender
-
$smtp_address
-
$smtp_port
Redefined in descendants as:
Add an attachment to the message
string
addAttachment
(string $file, [string $name = false], [string $mime_type = false], [boolean $isData = false], [string $cid = null])
-
string
$file: Either the Full path to the file to attach, either the data to attach itself
-
string
$name: Filename to use in the message
-
string
$mime_type: Mime type of the file (if not set application/octet-stream will be used)
-
boolean
$isData: Flag indicating if (when True) $file contains the data to attach, or (when false) if it is the path to a file to attach.
-
string
$cid: Attachment identifier (If not provided, it will be automatically generated)
Add "blind carbon copy" recipients to the mail
void
addBCC
(array|string $bcc)
-
array|string
$bcc: The e-mail address of the recipient, or an array of email addresses to add
Add "carbon copy" recipients to the mail
void
addCC
(array|string $cc)
-
array|string
$cc: The e-mail address of the recipient, or an array of email addresses to add
Add recipients to the mail
void
addRecipients
(array|string $recipients)
-
array|string
$recipients: The e-mail address of the recipient, or an array of email addresses to add
Send the message
void
send
()
Set the list of "blind carbon copy" recipients of the mail
void
setBCC
(array|string $bcc)
-
array|string
$bcc: The e-mail address of the recipient, or an array of email addresses
Set the list of "carbon copy" recipients of the mail
void
setCC
(array|string $cc)
-
array|string
$cc: The e-mail address of the recipient, or an array of email addresses
Set the address from which this e-mail wiil be send
void
setFrom
(string $from_address)
-
string
$from_address: E-mail address the recipient will see as beeing the sender of this e-mail
Set the body of the message
void
setMessage
(string $content, [string $type = mSmtp::MMAIL_TYPE_HTML], [string $encoding = mSmtp::MMAIL_ENCODING_UTF8], [string $xfertEncoding = mSmtp::MMAIL_TRANSFER_ENCODING_8BIT])
-
string
$content: Content of the message
-
string
$type: Mime type of the message (default is MMAIL_TYPE_HTML)
-
string
$encoding: Character encoding to use (default is MMAIL_ENCODING_UTF8)
-
string
$xfertEncoding: Content-Transfer-Encoding to use (default is MMAIL_TRANSFER_ENCODING_8BIT)
Set the priority level of the message
void
setPriority
([int $priority = mSmtp::MMAIL_PRIORITY_NORMAL])
-
int
$priority: Message's priority
Set the list of recipients of the mail
void
setRecipients
(array|string $recipients)
-
array|string
$recipients: The e-mail address of the recipient, or an array of email addresses
Set the address that the receiver will have to use to reply to your mail (its mail client will then ignore the 'from' address)
void
setReturnAddress
(string $return_address)
-
string
$return_address: E-mail address the recipient should use to reply to the mail
Set the SMTP Server Host
void
setSMTPServer
([string $smtp_address = "localhost"], [ $smtp_port = 25])
-
string
$smtp_address: SMTP Server
-
$smtp_port
Set the subject of the message
void
setSubject
(string $string)
-
string
$string: The subject of the message