Compare commits

...

4 Commits

Author SHA1 Message Date
Asif Bacchus 6135de4e5e Merge branch 'master' of https://git.asifbacchus.app/asif/phpmailerTest 2020-07-28 12:39:51 -06:00
Asif Bacchus d0e189be00 add stylesheet SRI 2020-07-28 12:39:36 -06:00
Asif Bacchus b03e7df159 add notation before log about settings being used 2020-07-28 12:39:25 -06:00
Asif Bacchus 8ca417d808 disable opportunistic TLS 2020-07-28 12:38:40 -06:00
2 changed files with 6 additions and 2 deletions

View File

@ -61,6 +61,7 @@ if (isset($_POST) && !empty($_POST)){
}
// send email IFF no NULL fields
if ($usePort && $useEncryption && $recipient && $replyTo){
$output .= '<< using port: ' . $usePort . ' with encryption: ' . $useEncryption . ' >><br>';
$body = 'This is a test message from the Simple PHPMailer Test Script. You may ignore this message.';
$subject = 'PHPMailer Test-Script Message';
$mailResult = sendEmail($SMTP['timeout'], $SMTP['hostname'], $usePort, $useEncryption, $SMTP['username'], $SMTP['password'], $recipient, $replyTo, $body, $subject);
@ -77,7 +78,7 @@ if (isset($_POST) && !empty($_POST)){
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Port Test</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="styles.css" integrity="sha384-9XO3MZfsbW7fC5tHf9nrGgI9BNaS4AEP0OoG6qQAY4PtIfCXaDAGObt6qBEHpyTa" crossorigin="anonymous">
</head>
<body>
<h1>Email Port Test</h1>

View File

@ -29,13 +29,16 @@ function sendEmail($timeout, $hostname, $usePort, $useEncryption, $username, $pa
$mail->SMTPAuth = true;
$mail->Username = $username;
$mail->Password = $password;
$mail->Port = $usePort;
// encryption setting
if ($useEncryption === 'ssl'){
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
} elseif ($useEncryption === 'starttls'){
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
} elseif ($useEncryption === 'none'){
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
}
$mail->Port = $usePort;
// recipients
$mail->setFrom($replyTo);