A class for sending email.
Prior to CMSMS 2.0 this class was implemented as a core module.
package |
CMS |
---|---|
license |
GPL |
since | 2.0 |
author |
Robert Campbell (calguy1000@cmsmadesimple.org) |
__construct(boolean $exceptions = true)
boolean
$exceptionsOptionally disable exceptions, and rely on error strings.
reset()
GetAltBody() : string
string
SetAltBody(string $txt)
For HTML messages the alternate body contains a text only string for email clients without HTML support.
string
$txtGetBody() : string
string
SetBody(string $txt)
If the email message is in HTML format this can contain HTML code. Otherwise it should contain only text.
string
$txtGetCharSet() : string
string
SetCharSet(string $charset)
Normally, the reset routine sets this to a system wide default value.
string
$charsetGetConfirmReadingTo() : string
string
The email address (if any) that will recieve the reading confirmation.
SetConfirmReadingTo(string $email)
string
$emailGetEncoding() : string
string
SetEncoding(string $encoding)
Possible values are: 8bit, 7bit, binary, base64, and quoted-printable
string
$encodingGetErrorInfo() : string
string
GetFrom() : string
string
SetFrom(string $email)
string
$emailTh email address that the email will be from.
GetFromName() : string
string
SetFromName(string $name)
string
$nameGetHelo() : string
string
SetHelo(string $helo)
string
$heloGetSMTPHost() : string
string
SetSMTPHost(string $host)
Only applicable when using SMTP mailer. All hosts must be separated with a semicolon. you can also specify a different port for each host by using the format hostname:port (e.g. "smtp1.example.com:25;smtp2.example.com"). Hosts will be tried in order
string
$hostGetHostname() : string
string
SetHostname(string $hostname)
string
$hostnameGetMailer() : string
string
SetMailer(string $mailer)
possible values for this field are 'mail','smtp', and 'sendmail'
string
$mailerGetSMTPPassword() : string
string
SetSMTPPassword(string $password)
Only useful when using the SMTP mailer.
string
$passwordGetSMTPPort() : integer
integer
SetSMTPPort(integer $port)
This method is only useful when using the SMTP mailer.
integer
$portGetPriority() : integer
integer
SetPriority(integer $priority)
integer
$priorityGetSender() : string
string
The email address for the Sender field
SetSender(string $sender)
string
$senderGetSendmail()
SetSendmail(string $path)
This path is only useful when using the sendmail mailer.
string
$pathGetSMTPAuth() : boolean
boolean
SetSMTPAuth(boolean $flag = true)
boolean
$flagGetSMTPDebug() : boolean
boolean
SetSMTPDebug(boolean $flag = TRUE)
This is only useful when using the SMTP mailer.
boolean
$flagGetSMTPKeepAlive() : boolean
boolean
SetSMTPKeepAlive(boolean $flag = true)
If this is set to true then SmtpClose must be used to close the connection
This method is only useful when using the SMTP mailer.
boolean
$flagGetSubject() : string
string
SetSubject(string $subject)
string
$subjectGetSMTPTimeout() : integer
integer
SetSMTPTimeout(integer $timeout)
integer
$timeoutGetSMTPUsername() : string
string
SetSMTPUsername(string $username)
This is only used when using the SMTP mailer with SMTP authentication.
string
$usernameGetWordWrap() : integer
integer
SetWordWrap(integer $chars)
integer
$charsAddAddress(string $address, string $name = '') : boolean
string
$addressThe email address
string
$nameThe real name
boolean
true on success, false if address already used
AddAttachment(string $path, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream') : boolean
string
$pathComplete file specification to the attachment
string
$nameSet the attachment name
string
$encodingFile encoding (see $encoding)
string
$type(mime type for the attachment)
boolean
true on success, false on failure.
AddBCC(string $addr, string $name = '') : boolean
string
$addrThe email address
string
$nameThe real name.
boolean
true on success, false on failure.
AddCC(string $addr, string $name = '') : boolean
string
$addrThe email address
string
$nameThe real name.
boolean
true on success, false on failure.
AddCustomHeader(string $header)
i.e: $obj->AddCustomHeader('X-MYHEADER: some-value');
string
$headerAddEmbeddedImage(string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream') : boolean
string
$pathPath to the attachment.
string
$cidContent ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
string
$nameOverrides the attachment name.
string
$encodingFile encoding (see $Encoding).
string
$typeFile extension (MIME) type.
boolean
AddReplyTo(string $addr, string $name = '') : boolean
string
$addrstring
$name boolean
AddStringAttachment(string $string, string $filename, string $encoding = 'base64', string $type = 'application/octet-stream')
This method can be used to attach ascii or binary data, such as a BLOB record from a database.
string
$stringString attachment data.
string
$filenameName of the attachment.
string
$encodingFile encoding (see $Encoding).
string
$typeFile extension (MIME) type.
ClearAddresses()
ClearAllRecipients()
ClearAttachments()
ClearBCCs()
ClearCCs()
ClearCustomHeaders()
ClearReplyTos()
IsError() : boolean
boolean
IsHTML(boolean $html = true)
boolean
$htmlIsMail() : boolean
boolean
IsSendmail() : boolean
boolean
IsSMTP() : boolean
boolean
Send() : boolean
This method may throw exceptions if $exceptions were enabled in the constructor
boolean
SetLanguage(string $lang_type)
string
$lang_typeSmtpClose()
GetSMTPSecure() : string
string
SetSMTPSecure(string $value)
string
$value