summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-11-22 14:45:14 +0300
committerAndrew Dolgov <[email protected]>2018-11-22 14:45:14 +0300
commit57932e183745bada9c6183056597cb5276f68d10 (patch)
tree7d64a815dd4bbf40dec51ee95be16c4ef7f7a212 /plugins
parent643d1919cc27a80aff424970b337e83be72720d1 (diff)
remove PHPMailer and related directives from config.php-dist; add pluggable Mailer class
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mail/init.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index 6525dc940..1b31a220b 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -183,13 +183,9 @@ class Mail extends Plugin {
}
function sendEmail() {
- require_once 'classes/ttrssmailer.php';
-
$reply = array();
- $mail = new ttrssMailer();
-
- $mail->AddReplyTo(strip_tags($_REQUEST['from_email']),
+ /*$mail->AddReplyTo(strip_tags($_REQUEST['from_email']),
strip_tags($_REQUEST['from_name']));
//$mail->AddAddress($_REQUEST['destination']);
$addresses = explode(';', $_REQUEST['destination']);
@@ -200,10 +196,22 @@ class Mail extends Plugin {
$mail->Subject = $_REQUEST['subject'];
$mail->Body = $_REQUEST['content'];
- $rc = $mail->Send();
+ $rc = $mail->Send(); */
+
+ $to = $_REQUEST["destination"];
+ $subject = strip_tags($_REQUEST["subject"]);
+ $message = strip_tags($_REQUEST["content"]);
+ $from = strip_tags($_REQUEST["from_email"]);
+
+ $mailer = new Mailer();
+
+ $mailer->mail(["to" => $to,
+ "headers" => ["Reply-To: $from"],
+ "subject" => $subject,
+ "message" => $message]);
if (!$rc) {
- $reply['error'] = $mail->ErrorInfo;
+ $reply['error'] = $mailer->error();
} else {
//save_email_address($destination);
$reply['message'] = "UPDATE_COUNTERS";
@@ -230,4 +238,4 @@ class Mail extends Plugin {
return 2;
}
-} \ No newline at end of file
+}