2024-01-11 18:04:08 +00:00
|
|
|
|
|
|
|
# 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](https://github.com/PHPMailer/PHPMailer).
|
|
|
|
|
|
|
|
```php
|
|
|
|
$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}";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
---
|
|
|
|
|
2024-01-25 09:08:26 +00:00
|
|
|
## Todo
|
|
|
|
|
|
|
|
- add behaviours used in former phpmailer implementations for CONTENIDO
|
|
|
|
- add backend area for default configurations (SMTP, ec.)
|
|
|
|
|
2024-01-11 18:04:08 +00:00
|
|
|
## History
|
|
|
|
|
2024-01-25 09:08:26 +00:00
|
|
|
#### V1.0.0
|
2024-01-11 18:04:08 +00:00
|
|
|
|
|
|
|
- first official release of PHPMailer plugin
|
|
|
|
|
2024-01-25 09:08:26 +00:00
|
|
|
#### V0.0.2
|
|
|
|
|
|
|
|
- internal testing
|
|
|
|
|
|
|
|
#### V0.0.1
|
2024-01-11 18:04:08 +00:00
|
|
|
|
|
|
|
- initial version of PHPMailer plugin (intern)
|
|
|
|
|
|
|
|
|