diff --git a/.gitignore b/.gitignore index cdb3d20..c322e33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ vendor/ -composer.lock \ No newline at end of file +composer.lock +tests/test.config.php \ No newline at end of file diff --git a/tests/test.jpg b/tests/test.jpg new file mode 100644 index 0000000..30b7f70 Binary files /dev/null and b/tests/test.jpg differ diff --git a/tests/test.php b/tests/test.php new file mode 100644 index 0000000..247b6ee --- /dev/null +++ b/tests/test.php @@ -0,0 +1,40 @@ +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' +
Hello,
+This is a test mail for PHPMailerEnhanced.
+
+ Here is an embed image :
+
+
Best regards.
+HTML; + + $mail->setFrom(MAIL_SENDER); + $mail->addAddress(MAIL_DEST); + + var_dump($mail->send(__DIR__)); +} +catch (Throwable $exception) { + var_dump($exception->getMessage()); + exit; +}