Files
dog/php/php-dog/tstEmail.php
2023-02-08 01:24:59 +01:00

39 lines
1017 B
PHP

<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require __DIR__.'../../vendor/autoload.php';
//Load Composer's autoloader
require __DIR__.'./classes/lib.php';
//Create an instance; passing `true` enables exceptions
$mail = new CNetcupMailer(true);
try {
//Server settings
//Recipients
$mail->setFrom('p.para@gmx.de', 'Mailer');
$mail->addAddress('p.hoppe@gmx.de', 'Joe User'); //Add a recipient
$mail->addReplyTo('p.para@gmx.de', 'Information');
$mail->addCC('p.para@gmx.de');
$mail->addBCC('dog@hope-fly.de');
//Attachments
//Content
$mail->Subject = 'jo subject jo XXXXX';
$mail->Body = 'XXXX This is the txt message bodyThis is the txt message body This is the txt message bodyThis is the txt message body';
$mail->send();
echo 'Message has been sent';
}
catch (Exception $e)
{
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>