summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-06 12:29:02 -0400
committerMalf Furious <m@lfurio.us>2017-06-19 23:57:39 -0400
commit613ef13e809c3f083a76797c7706935d3bbfcb29 (patch)
tree0aae7b5ce1ca4a7de104fd875964d69cd047cdf6 /app
parent05c33eb8da0c926c07288ddb07821fb967e20d7d (diff)
downloadscrott-613ef13e809c3f083a76797c7706935d3bbfcb29.tar.gz
scrott-613ef13e809c3f083a76797c7706935d3bbfcb29.zip
Revert "Add global function sendEmail()"
This reverts commit 45889e98e7a12b22cbaaceedd5531d4158888530. This reverts commit 6b643d4bbb469d35c6664176bc1aa641d130d99f. This reverts commit 7872377be7a0fc97316fc20d28a4bcfec15c6111. This feature was moved to another file.
Diffstat (limited to 'app')
-rw-r--r--app/class/globals.php42
1 files changed, 0 insertions, 42 deletions
diff --git a/app/class/globals.php b/app/class/globals.php
index 0d4b0ac..615efa6 100644
--- a/app/class/globals.php
+++ b/app/class/globals.php
@@ -12,10 +12,6 @@
* For more information, please refer to UNLICENSE
*/
-require_once "class/settings.class.php";
-require_once "class/phpmailer.class.php";
-require_once "class/smtp.class.php";
-
/*
* This file defines various functions which exist in the global namespace.
* These are utility functions and constants for the Scrott application.
@@ -148,42 +144,4 @@ function saveFile(array $file, string $path, int $maxsize, ?array $allowedMime =
return true;
}
-/*
- * Send an email message using database-stored configuration
- * parameters. If config is not established, delivery is
- * not attempted. Send status (t/f) is returned.
- */
-function sendEmail(string $subject, user $rcpt, string $mesg,
- ?string $attachPath = NULL, ?string $attachName = NULL,
- bool $overrideEmailConf = false) : bool
-{
- if (settings::smtpServer() == "")
- return false;
-
- if (!$overrideEmailConf && !$rcpt->emailConf)
- return true;
-
- if ($rcpt->email == "")
- return true;
-
- $mail = new PHPMailer();
- $mail->isSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = settings::smtpServer();
- $mail->Username = settings::smtpUname();
- $mail->Password = settings::smtpPasswd();
- $mail->SMTPSecure = settings::smtpSecurity();
- $mail->Port = settings::smtpPort();
-
- $mail->setFrom(settings::smtpEmailAddress());
- $mail->addAddress($rcpt->email, $rcpt->getDisplayName());
- $mail->Subject = $subject;
- $mail->Body = $mesg;
-
- if ($attachPath && $attachName)
- $mail->addAttachment($attachPath, $attachName);
-
- return $mail->send();
-}
-
?>