-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace PeeHaa\MailGrab\Examples; | ||
|
||
use PHPMailer\PHPMailer\PHPMailer; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$mail = new PHPMailer(); | ||
|
||
$mail->isSMTP(); | ||
$mail->Host = 'localhost'; | ||
$mail->Port = 9025; | ||
$mail->SMTPDebug = true; | ||
|
||
$mail->setFrom('from@example.com', 'M. Sender'); | ||
$mail->addAddress('to.with.name@example.net', 'Joe User'); | ||
$mail->addAddress('to.without.name@example.com'); | ||
$mail->addReplyTo('reply.to@example.com', 'Reply Address'); | ||
$mail->addCC('cc@example.com'); | ||
$mail->addBCC('bcc@example.com'); | ||
|
||
$mail->Subject = 'PHPMailer'; | ||
$mail->Body = 'This is the HTML body.'; | ||
$mail->AltBody = 'This is the plain text body.'; | ||
|
||
if(!$mail->send()) { | ||
echo 'Message could not be sent.'; | ||
echo 'Mailer Error: ' . $mail->ErrorInfo; | ||
} else { | ||
echo 'Message has been sent'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters