1
0
Fork 0
PHPMailer plugin for CMS CONTENIDO >= 4.10.x
Datei suchen
Ortwin Pinke 8ee5a0a6fd README.md aktualisiert 2024-01-25 09:08:26 +00:00
classes init plugin 2024-01-11 17:21:03 +01:00
includes add phpmailer class to CONTENIDO autoloader 2024-01-25 09:03:35 +00:00
vendor add vendor folder 2024-01-12 19:14:32 +01:00
.gitattributes .gitattributes aktualisiert 2024-01-24 16:12:14 +00:00
README.md README.md aktualisiert 2024-01-25 09:08:26 +00:00
composer.json init plugin 2024-01-11 17:21:03 +01:00
composer.lock init plugin 2024-01-11 17:21:03 +01:00
plugin.xml plugin.xml aktualisiert 2024-01-25 08:57:09 +00:00

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)