summaryrefslogtreecommitdiff
path: root/register.php
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 /register.php
parent643d1919cc27a80aff424970b337e83be72720d1 (diff)
remove PHPMailer and related directives from config.php-dist; add pluggable Mailer class
Diffstat (limited to 'register.php')
-rw-r--r--register.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/register.php b/register.php
index d03218fc1..98d49319d 100644
--- a/register.php
+++ b/register.php
@@ -7,7 +7,6 @@
set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
get_include_path());
- require_once 'classes/ttrssmailer.php';
require_once "autoload.php";
require_once "functions.php";
require_once "sessions.php";
@@ -308,15 +307,13 @@
"\n".
"If that wasn't you, just ignore this message. Thanks.";
- $mail = new ttrssMailer();
- $mail->IsHTML(false);
- $rc = $mail->quickMail($email, "", "Registration information for Tiny Tiny RSS", $reg_text, false);
+ $mailer = new Mailer();
+ $rc = $mailer->mail(["to" => $email,
+ "subject" => "Registration information for Tiny Tiny RSS",
+ "message" => $reg_text]);
- if (!$rc) print_error($mail->ErrorInfo);
+ if (!$rc) print_error($mailer->error());
- unset($reg_text);
- unset($mail);
- unset($rc);
$reg_text = "Hi!\n".
"\n".
"New user had registered at your Tiny Tiny RSS installation.\n".
@@ -324,11 +321,12 @@
"Login: $login\n".
"Email: $email\n";
+ $mailer = new Mailer();
+ $rc = $mailer->mail(["to" => REG_NOTIFY_ADDRESS,
+ "subject" => "Registration notice for Tiny Tiny RSS",
+ "message" => $reg_text]);
- $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);
+ if (!$rc) print_error($mailer->error());
print_notice(__("Account created successfully."));
@@ -364,4 +362,3 @@
</body>
</html>
-