From 0730128a97a46054099b59554e891cee99829eaa Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 3 Mar 2021 14:00:18 +0300 Subject: add a send test email button to prefs/system --- classes/pref/system.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'classes/pref/system.php') diff --git a/classes/pref/system.php b/classes/pref/system.php index 85635e753..e58765c49 100644 --- a/classes/pref/system.php +++ b/classes/pref/system.php @@ -14,6 +14,20 @@ class Pref_System extends Handler_Administrative { $this->pdo->query("DELETE FROM ttrss_error_log"); } + function sendTestEmail() { + $mail_address = clean($_REQUEST["mail_address"]); + + $mailer = new Mailer(); + + $rc = $mailer->mail(["to_name" => "", + "to_address" => $mail_address, + "subject" => __("Test message from tt-rss"), + "message" => ("This message confirms that tt-rss can send outgoing mail.") + ]); + + print json_encode(['rc' => $rc, 'error' => $mailer->error()]); + } + function getphpinfo() { ob_start(); phpinfo(); @@ -161,6 +175,41 @@ class Pref_System extends Handler_Administrative { ?> +
'> +
+ +
+ + + + + +
+ + 1]) ?> + + +
+
+
+
'>