parent
13a5c33701
commit
08ec09f024
@ -1,3 +1,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
vendor/
|
vendor/
|
||||||
composer.lock
|
composer.lock
|
||||||
|
tests/test.config.php
|
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,40 @@
|
|||||||
|
<?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;
|
||||||
|
}
|
Loading…
Reference in New Issue