[Plugin] PHPMailer Plugin for CONTENIDO

Alles rund um Module und Plugins in CONTENIDO 4.10.
Antworten
Oldperl
Beiträge: 4289
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Kontaktdaten:

[Plugin] PHPMailer Plugin for CONTENIDO

Beitrag von Oldperl »

Servus,

da ich in letzter Zeit häufiger alte Module, die den PHPMailer nutzen, in der Mache hatte und dieser ja nicht mehr zu den Standard-Libs von CONTENIDO gehört, habe ich mir mal ein einfaches Plugin für den PHPMailer gemacht.
Dieses nutzt die aktuelle Version des PHPMailer von Github. Sobald das Plugin installiert und aktiviert ist, könnt ihr diesen dann in euren Modulen nutzen. Den Beispielcode müsst ihr natürlich entsprechend eurer benötigten Konfiguration anpassen, der ist jetzt so aus dem Git des PHPMailer übernommen.

Vorraussetzungen
  • CONTENIDO Version 4.10.1
  • PHP >= 8.0
  • Kein anderer PHPMailer installiert

Code: Alles auswählen

$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}";
}
Für Bugs, Ideen, Wünsche oder Anregungen zum Plugin steht euch ein Ticket-System zur Verfügung.

Mein Git-Repository findet ihr hier :arrow: https://gitport.de/phpBO/phpmailer
Aktuelle Releases und Downloads findet ihr hier :arrow: https://gitport.de/phpBO/phpmailer/releases
Das Ticketsystem findet ihr hier :arrow: https://gitport.de/phpBO/phpmailer/issues

Hoffe ihr könnt das Teil gebrauchen. Freue mich schon auf euer Feedback.

Gruß aus Franken

Ortwin
ConLite 2.1, alternatives und stabiles Update von Contenido 4.8.x unter PHP 7.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
Faar
Beiträge: 1929
Registriert: Sa 8. Sep 2007, 16:23
Wohnort: Brandenburg
Kontaktdaten:

Re: [Plugins] PHPMailer Plugin for CONTENIDO

Beitrag von Faar »

Danke
Fliegt der Bauer übers Dach, ist der Wind weißgott nicht schwach.
bodil
Beiträge: 349
Registriert: Fr 7. Okt 2011, 04:10
Kontaktdaten:

Re: [Plugins] PHPMailer Plugin for CONTENIDO

Beitrag von bodil »

Das hört sich gut an! Wie sich hier die Dinge entwickeln, könnte das demnächst zum Einsatz kommen! Vielen Dank!
McHubi
Beiträge: 1213
Registriert: Do 18. Nov 2004, 23:06
Wohnort: Mettmann
Kontaktdaten:

Re: [Plugins] PHPMailer Plugin for CONTENIDO

Beitrag von McHubi »

Danke, Ortwin. Habe es mit aufgenommen unter viewtopic.php?f=116&t=43506&p=179642
seamless-design.de
"Geht nicht!" wohnt in der "Will nicht!"-Strasse.

Das Handbuch zur Version 4.10: CONTENIDO für Einsteiger (4.10)

Das Handbuch zur Version 4.9: CONTENIDO für Einsteiger (4.9)
Oldperl
Beiträge: 4289
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Kontaktdaten:

Re: [Plugin] PHPMailer Plugin for CONTENIDO

Beitrag von Oldperl »

Ich danke Dir, Markus. :D

Gruß aus Franken

Ortwin
ConLite 2.1, alternatives und stabiles Update von Contenido 4.8.x unter PHP 7.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
Antworten