class Mail extends PHPMailer
Email Class. Provides a common interface to send email from the Joomla! Platform
Properties
string | $CharSet | Charset of the message. |
Methods
Constructor
Returns the global email object, only creating it if it doesn't already exist.
Send the mail
Set the From and FromName properties.
Set the email subject
Add recipients to the email
Add file attachment to the email
Unset all file attachments from the email
Unset file attachments specified by array index.
Add Reply to email address(es) to the email
Send messages using $Sendmail.
Use sendmail for sending the email
Use SMTP for sending the email
Function to send an email
Sends mail to administrator for approval of a user submission
Details
static
Mail
getInstance(
string $id = 'Joomla',
boolean $exceptions = true)
Returns the global email object, only creating it if it doesn't already exist.
NOTE: If you need an instance to use that does not have the global configuration values, use an id string that is not 'Joomla'.
boolean
setFrom(
string $address,
string $name = '',
boolean $auto = true)
Set the From and FromName properties.
Mail|boolean
addAttachment(
mixed $path,
mixed $name = '',
mixed $encoding = 'base64',
mixed $type = 'application/octet-stream',
string $disposition = 'attachment')
Add file attachment to the email
Mail|boolean
addReplyTo(
mixed $replyto,
mixed $name = '')
Add Reply to email address(es) to the email
void
isSendmail()
Send messages using $Sendmail.
This overrides the parent class to remove the restriction on the executable's name containing the word "sendmail"
boolean
useSmtp(
string $auth = null,
string $host = null,
string $user = null,
string $pass = null,
string $secure = null,
integer $port = 25)
Use SMTP for sending the email