PHPMailer plugin for CMS CONTENIDO >= 4.10.x
classes | ||
includes | ||
vendor | ||
.gitattributes | ||
composer.json | ||
composer.lock | ||
plugin.xml | ||
README.md |
PHPMailer Plugin for CONTENIDO
This plugin will add PHPMailer to your CONTENIDO CMS. You need at last version 4.10.1
You may use PHPMailer in your module, plugin or other project within CONTENIDO using the following sample code, which can be found in README file of the PHPMailer lib, which you can get on github.
$mailer = new PHPMailer(true);
try {
//Server settings
$mailer->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mailer->isSMTP(); //Send using SMTP
$mailer->Host = 'smtp.example.com'; //Set the SMTP server to send through
$mailer->SMTPAuth = true; //Enable SMTP authentication
$mailer->Username = 'user@example.com'; //SMTP username
$mailer->Password = 'secret'; //SMTP password
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mailer->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mailer->setFrom('from@example.com', 'Mailer');
$mailer->addAddress('joe@example.net', 'Joe User'); //Add a recipient
$mailer->addAddress('ellen@example.com'); //Name is optional
$mailer->addReplyTo('info@example.com', 'Information');
$mailer->addCC('cc@example.com');
$mailer->addBCC('bcc@example.com');
//Attachments
$mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Todo
- add behaviours used in former phpmailer implementations for CONTENIDO
- add backend area for default configurations (SMTP, ec.)
History
V1.0.0
- first official release of PHPMailer plugin
V0.0.2
- internal testing
V0.0.1
- initial version of PHPMailer plugin (intern)