mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-04 16:19:15 +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:
67
register.php
67
register.php
@@ -7,7 +7,7 @@
|
||||
set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
|
||||
get_include_path());
|
||||
|
||||
require_once 'lib/phpmailer/class.phpmailer.php';
|
||||
require_once 'classes/ttrssmailer.php';
|
||||
|
||||
require_once "functions.php";
|
||||
require_once "sessions.php";
|
||||
@@ -306,65 +306,28 @@
|
||||
"\n".
|
||||
"If that wasn't you, just ignore this message. Thanks.";
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$mail->PluginDir = "lib/phpmailer/";
|
||||
$mail->SetLanguage("en", "lib/phpmailer/language/");
|
||||
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
$mail->From = SMTP_FROM_ADDRESS;
|
||||
$mail->FromName = SMTP_FROM_NAME;
|
||||
$mail->AddAddress($email);
|
||||
|
||||
if (SMTP_HOST) {
|
||||
$mail->Host = SMTP_HOST;
|
||||
$mail->Mailer = "smtp";
|
||||
$mail->Username = SMTP_LOGIN;
|
||||
$mail->Password = SMTP_PASSWORD;
|
||||
}
|
||||
|
||||
// $mail->IsHTML(true);
|
||||
$mail->Subject = "Registration information for Tiny Tiny RSS";
|
||||
$mail->Body = $reg_text;
|
||||
// $mail->AltBody = $digest_text;
|
||||
|
||||
$rc = $mail->Send();
|
||||
$mail = new ttrssMailer();
|
||||
$mail->IsHTML(false);
|
||||
$rc = $mail->quickMail($email, "", "Registration information for Tiny Tiny RSS", $reg_text, false);
|
||||
|
||||
if (!$rc) print_error($mail->ErrorInfo);
|
||||
|
||||
|
||||
unset($reg_text);
|
||||
unset($mail);
|
||||
unset($rc);
|
||||
$reg_text = "Hi!\n".
|
||||
"\n".
|
||||
"New user had registered at your Tiny Tiny RSS installation.\n".
|
||||
"\n".
|
||||
"Login: $login\n".
|
||||
"Email: $email\n";
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$mail->PluginDir = "lib/phpmailer/";
|
||||
$mail->SetLanguage("en", "lib/phpmailer/language/");
|
||||
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
$mail->From = SMTP_FROM_ADDRESS;
|
||||
$mail->FromName = SMTP_FROM_NAME;
|
||||
$mail->AddAddress(REG_NOTIFY_ADDRESS);
|
||||
|
||||
if (SMTP_HOST) {
|
||||
$mail->Host = SMTP_HOST;
|
||||
$mail->Mailer = "smtp";
|
||||
$mail->Username = SMTP_LOGIN;
|
||||
$mail->Password = SMTP_PASSWORD;
|
||||
}
|
||||
|
||||
// $mail->IsHTML(true);
|
||||
$mail->Subject = "Registration notice for Tiny Tiny RSS";
|
||||
$mail->Body = $reg_text;
|
||||
// $mail->AltBody = $digest_text;
|
||||
|
||||
$rc = $mail->Send();
|
||||
|
||||
|
||||
|
||||
$mail = new ttrssMailer();
|
||||
$mail->IsHTML(false);
|
||||
$rc = $mail->quickMail(REG_NOTIFY_ADDRESS, "", "Registration notice for Tiny Tiny RSS", $reg_text, false);
|
||||
if (!$rc) print_error($mail->ErrorInfo);
|
||||
|
||||
print_notice(__("Account created successfully."));
|
||||
|
||||
print "<p><form method=\"GET\" action=\"index.php\">
|
||||
|
||||
Reference in New Issue
Block a user