summaryrefslogtreecommitdiff
path: root/plugins/mail
diff options
context:
space:
mode:
authorderekmurawsky <[email protected]>2013-03-22 16:25:12 -0400
committerderekmurawsky <[email protected]>2013-03-22 16:25:12 -0400
commit1b2afd2bd3dc19cdd36da47cc52040a83cdb3b68 (patch)
tree286d5b99c3a895d2f756fae5c17a55122ee7a7f0 /plugins/mail
parent9d9432dab87e3887e4f482ac5afff1586530c692 (diff)
Additions:
classes/trssmailer.php - Created class TTRSS mailer which extends phpmailer and sets the default mail settings upon instantiation. Class includes quickmail function that allows for a quick email send with no extra configurion necessary. Changes: config.php-dist - Added the smtp port option include/digest.php - Converted it to use the new ttrrssmailer class include/sanity_config.php - Added the smtp port option to the sanity check plugins/mail/init.php - Modified to use ttrssmailer class. This particular configuration shows a hybrid use case. register.php = Modified to use ttrssmailer class. All code was tested and functioned on my local machine.
Diffstat (limited to 'plugins/mail')
-rw-r--r--plugins/mail/init.php27
1 files changed, 5 insertions, 22 deletions
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index 30a417a1b..9d92781d7 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -137,7 +137,7 @@ class Mail extends Plugin {
function sendEmail() {
$secretkey = $_REQUEST['secretkey'];
- require_once 'lib/phpmailer/class.phpmailer.php';
+ require_once 'classes/ttrssmailer.php';
$reply = array();
@@ -146,35 +146,18 @@ class Mail extends Plugin {
$_SESSION['email_secretkey'] = '';
- $destination = $_REQUEST['destination'];
- $subject = $_REQUEST['subject'];
- $content = $_REQUEST['content'];
-
$replyto = strip_tags($_SESSION['email_replyto']);
$fromname = strip_tags($_SESSION['email_fromname']);
- $mail = new PHPMailer();
-
- $mail->PluginDir = "lib/phpmailer/";
- $mail->SetLanguage("en", "lib/phpmailer/language/");
-
- $mail->CharSet = "UTF-8";
+ $mail = new ttrssMailer();
$mail->From = $replyto;
$mail->FromName = $fromname;
- $mail->AddAddress($destination);
-
- if (SMTP_HOST) {
- $mail->Host = SMTP_HOST;
- $mail->Mailer = "smtp";
- $mail->SMTPAuth = SMTP_LOGIN != '';
- $mail->Username = SMTP_LOGIN;
- $mail->Password = SMTP_PASSWORD;
- }
+ $mail->AddAddress($_REQUEST['destination']);
$mail->IsHTML(false);
- $mail->Subject = $subject;
- $mail->Body = $content;
+ $mail->Subject = $_REQUEST['subject'];
+ $mail->Body = $_REQUEST['content'];
$rc = $mail->Send();