summaryrefslogtreecommitdiff
path: root/http/php/mail.php
diff options
context:
space:
mode:
Diffstat (limited to 'http/php/mail.php')
-rw-r--r--http/php/mail.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/http/php/mail.php b/http/php/mail.php
deleted file mode 100644
index d9c4125..0000000
--- a/http/php/mail.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php namespace JoeacNet\Http\Mail;
-
-use PHPMailer\PHPMailer\PHPMailer;
-
-use JoeacNet\Http\Config;
-
-require_once __DIR__ . "/../vendor/autoload.php";
-
-function sendEmail(
- string $toEmail,
- string $toName,
- string $subject,
- string $body,
- string $replyToEmail = null,
- string $replyToName = null,
-): string {
- $mail = new PHPMailer();
- $mail->isSMTP();
- $mail->Host = Config\localSmtpHost();
- $mail->Port = Config\localSmtpPort();
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
- $mail->Username = Config\localSmtpUser();
- $mail->Password = Config\localSmtpPass();
- $mail->setFrom(Config\localSmtpFrom(), Config\localSmtpFromName());
- if (!is_null($replyToEmail)) {
- $mail->addReplyTo($replyToEmail, $replyToName);
- }
- $mail->addAddress($toEmail, $toName);
- $mail->isHTML(false);
- $mail->Subject = "joeac.net: $subject";
- $mail->Body = "$body";
- $mail->send();
- return $mail->getLastMessageID();
-}