0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00

Allow local override of SMTP auth settings in tests; allows easy use of HELO (which requires a username) for local testing

This commit is contained in:
Marcus Bointon 2020-08-04 09:46:12 +02:00
parent efb0c4dcb8
commit ecdf374c74
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24

View File

@ -106,6 +106,15 @@ final class PHPMailerTest extends TestCase
$this->Mail->SMTPAuth = false;
$this->Mail->Username = '';
$this->Mail->Password = '';
if (array_key_exists('mail_useauth', $_REQUEST)) {
$this->Mail->SMTPAuth = $_REQUEST['mail_useauth'];
}
if (array_key_exists('mail_username', $_REQUEST)) {
$this->Mail->Username = $_REQUEST['mail_username'];
}
if (array_key_exists('mail_userpass', $_REQUEST)) {
$this->Mail->Password = $_REQUEST['mail_userpass'];
}
$this->Mail->addReplyTo('no_reply@phpmailer.example.com', 'Reply Guy');
$this->Mail->Sender = 'unit_test@phpmailer.example.com';
if ($this->Mail->Host != '') {