Compare commits
4 Commits
e77de8e40b
...
6135de4e5e
Author | SHA1 | Date |
---|---|---|
Asif Bacchus | 6135de4e5e | |
Asif Bacchus | d0e189be00 | |
Asif Bacchus | b03e7df159 | |
Asif Bacchus | 8ca417d808 |
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue