aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/Functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/Functions.php')
-rw-r--r--bootstrap/Functions.php26
1 files changed, 13 insertions, 13 deletions
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);
}