PHPMailer is a third party class for sending emails, Full docs are available at https://github.com/Synchro/PHPMailer
To use PHPMailer create a new instance of it:
$mail = new \Helpers\PhpMailer\Mail();
Once an instance has been created all the properties are available to you, a typical example:
$mail = new \\Helpers\\PhpMailer\\Mail(); $mail->setFrom('email@example.com'); $mail->addAddress('firstname.lastname@example.org'); $mail->subject('Important Email'); $mail->body("<h1>Hey</h1>I like this <b>Bold</b> Text!"); $mail->send();
The class has the ability to send via SMTP in order to do so edit Helpers/PhpMailer/Mail.php and enter your SMTP settings you can also set a default email from address so you don't have to supply it each time:
public $From = 'email@example.com'; public $FromName = SITETITLE; public $Host = 'smtp.gmail.com'; public $Mailer = 'smtp'; public $SMTPAuth = true; public $Username = 'firstname.lastname@example.org'; public $Password = 'password'; public $SMTPSecure = 'tls'; public $WordWrap = 75;
You don't need to specify a plain text version of the email to be sent out, this is done automatically from the supplied body.