From 0268f14255191dfb1a4b65169c83bc15a621935d Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Sat, 29 Jun 2019 13:56:27 -0400 Subject: bootstrap/Functions: Remove reply to since it causes Yahoo not to send mail --- bootstrap/Functions.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/Functions.php b/bootstrap/Functions.php index cba90aa..9bd0e82 100644 --- a/bootstrap/Functions.php +++ b/bootstrap/Functions.php @@ -7,32 +7,32 @@ use PHPMailer\PHPMailer\Exception; function sendMail($name, $email, $message) { // Require mail config - $config = require '../AppConfig.php'; + $config = include '../AppConfig.php'; $mail = new PHPMailer(true); try { //Server settings - //$mail->SMTPDebug = 2; // Enable verbose debug output - $mail->isSMTP(); // Set mailer to use SMTP - $mail->Host = $config['mail']['host']; // Specify main and backup SMTP servers - $mail->SMTPAuth = true; // Enable SMTP authentication - $mail->Username = $config['mail']['username']; // SMTP username - $mail->Password = $config['mail']['password']; // SMTP password - $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted - $mail->Port = $config['mail']['port']; // TCP port to connect to + //$mail->SMTPDebug = 2; + $mail->isSMTP(); + $mail->SMTPAuth = true; + $mail->SMTPSecure = 'ssl'; + $mail->Port = $config['mail']['port']; + $mail->Host = $config['mail']['host']; + $mail->Username = $config['mail']['username']; + $mail->Password = $config['mail']['password']; //Recipients $mail->setFrom($config['mail']['username'], 'Edwin Mattiacci'); $mail->addAddress($config['mail']['username'], 'Edwin Mattiacci'); - $mail->addReplyTo($email, $name); //Content $mail->isHTML(true); - $mail->Subject = 'New message from ' . $name; - $mail->Body = $message; - $mail->AltBody = $message; + $mail->Subject = 'New message from ' . $email; + $mail->Body = $message . "\n\n" . $name . "\n" . $email; + $mail->AltBody = $message . "\n\n" . $name . "\n" . $email; $mail->send(); + } catch (Exception $exception) { log_exception($exception); } -- cgit v1.2.3