mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 20:45:55 +00:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user