You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
903 B
PHP
41 lines
903 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
require_once __DIR__ . '/test.config.php';
|
|
|
|
use jrosset\PHPMailerEnhanced\PHPMailerEnhanced;
|
|
|
|
try {
|
|
$mail = new PHPMailerEnhanced();
|
|
//$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
|
|
|
$mail->isSMTP();
|
|
$mail->Host = MAIL_HOST;
|
|
$mail->Port = MAIL_PORT;
|
|
$mail->SMTPAuth = MAIL_AUTH;
|
|
$mail->SMTPSecure = MAIL_SECURITY;
|
|
$mail->Username = MAIL_USER;
|
|
$mail->Password = MAIL_PASS;
|
|
|
|
$mail->isHTML();
|
|
$mail->Subject = 'Test';
|
|
$mail->Body = <<<'HTML'
|
|
<p>Hello,</p>
|
|
<p>This is a test mail for PHPMailerEnhanced.</p>
|
|
<p>
|
|
Here is an embed image :
|
|
<br><img src="/test.jpg" alt="Bird image">
|
|
</p>
|
|
<p>Best regards.</p>
|
|
HTML;
|
|
|
|
$mail->setFrom(MAIL_SENDER);
|
|
$mail->addAddress(MAIL_DEST);
|
|
|
|
var_dump($mail->send(__DIR__));
|
|
}
|
|
catch (Throwable $exception) {
|
|
var_dump($exception->getMessage());
|
|
exit;
|
|
}
|