WTMail Class
A Class to send email
Example:
$mail = new WTMail();
$mail->setFrom("contact@webtemplate.com.au", "WebTemplate");
$mail->setTo("contact@domain.com")
$mail->setContent("subject", "
Item Index
Methods
addAttachment
-
path -
[name]
Add an attachment to the email
Parameters:
-
pathStringThe path to the file to attach
-
[name]String optionalThe name of the attachment
addEmbeddedImage
-
path -
contentID -
[name] -
[encoding="base64"] -
[mimeType]
Add an embedded image to the email
TODO: provide an example
Parameters:
-
pathStringThe path to the image
-
contentIDStringThe id used to identify the image
-
[name]String optionalThe name of the image
-
[encoding="base64"]String optionalThe encoding to be used for the image
-
[mimeType]String optionalThe mime type. If not supplied, the mime type will be determined from the extension
send
()
Send the email
setBCC
-
address
Set the blind carbon copy address for the email
Parameters:
-
addressStringThe email address of the BCC recipient (Can be a comma separated list of addresses)
setCC
-
address
Set the carbon copy addresses for the email
Parameters:
-
addressStringThe email address of the CC recipient (Can be a comma separated list of addresses)
setContent
-
subject -
body -
[bodyIsHTML=false] -
altbody
Set the content of the email
Parameters:
-
subjectStringThe subject of the email
-
bodyStringThe body of the email
-
[bodyIsHTML=false]Boolean optionalSet to false if sending a HTML email
-
altbodyStringThe plain text version of a HTML email
setEncrypt
-
doEncryption -
publicKey
Set whether to encrypt the email
Parameters:
-
doEncryptionBooleanSet to true to encrypt the email
-
publicKeyStringthe gnupg public key to be used to encrypt the email
setFrom
-
address -
[name]
Set who the email is from
Parameters:
-
addressStringThe email address of the sender
-
[name]String optionalThe name of the sender
setReplyTo
-
address
Set the reply to address of the email
Parameters:
-
addressStringThe reply to address of the email
setTo
-
address
Set who the email will be sent to
Parameters:
-
addressStringThe email address of the person to send the email to
