diff --git a/classes/mailer.php b/classes/mailer.php
index 968caf54a7880873b65bf6845f1517f46d32dec9..564338f6976c04a678dcb845db08d9f10a3728b2 100644
--- a/classes/mailer.php
+++ b/classes/mailer.php
@@ -1,8 +1,6 @@
 <?php
 class Mailer {
-	// TODO: support HTML mail (i.e. MIME messages)
-
-	private $last_error = "Unable to send mail: check local configuration.";
+	private $last_error = "";
 
 	function mail($params) {
 
@@ -39,11 +37,18 @@ class Mailer {
 
 		$headers = [ "From: $from_combined", "Content-Type: text/plain; charset=UTF-8" ];
 
-		return mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers)));
+		$rc = mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers)));
+
+		if (!$rc) {
+			$this->set_error(error_get_last()['message']);
+		}
+
+		return $rc;
 	}
 
 	function set_error($message) {
 		$this->last_error = $message;
+		user_error("Error sending mail: $message", E_USER_WARNING);
 	}
 
 	function error() {
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index e96bbaa7cf67cb8672ab4f10f9f102061884c4d2..bd0e9f4d83c0757c12722d68447a1934314664a8 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -61,7 +61,7 @@ class PluginHost {
 	const HOOK_FEED_BASIC_INFO = "hook_feed_basic_info";										// hook_feed_basic_info($basic_info, $fetch_url, $owner_uid, $feed_id, $auth_login, $auth_pass) (byref)
 	const HOOK_SEND_LOCAL_FILE = "hook_send_local_file";										// hook_send_local_file($filename)
 	const HOOK_UNSUBSCRIBE_FEED = "hook_unsubscribe_feed";									// hook_unsubscribe_feed($feed_id, $owner_uid)
-	const HOOK_SEND_MAIL = "hook_send_mail";														// hook_send_mail($mailer, $params)
+	const HOOK_SEND_MAIL = "hook_send_mail";														// hook_send_mail(Mailer $mailer, $params)
 	const HOOK_FILTER_TRIGGERED = "hook_filter_triggered";									// hook_filter_triggered($feed_id, $owner_uid, $article, $matched_filters, $matched_rules, $article_filters)
 	const HOOK_GET_FULL_TEXT = "hook_get_full_text";											// hook_get_full_text($url)
 	const HOOK_ARTICLE_IMAGE = "hook_article_image";											// hook_article_image($enclosures, $content, $site_url)
diff --git a/classes/pref/system.php b/classes/pref/system.php
index 85635e753a4a7713ca5a7444e0b761178033c5c9..e58765c496eb0d46695ed03ed504352c22f6f21a 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 {
 				?>
 			</div>
 
+			<div dojoType='dijit.layout.AccordionPane' style='padding : 0' title='<i class="material-icons">mail</i> <?= __('Mail Configuration') ?>'>
+				<div dojoType="dijit.layout.ContentPane">
+
+					<form dojoType="dijit.form.Form">
+						<script type="dojo/method" event="onSubmit" args="evt">
+							evt.preventDefault();
+							if (this.validate()) {
+								xhr.json("backend.php", this.getValues(), (reply) => {
+									const msg = App.byId("mail-test-result");
+
+									if (reply.rc) {
+										msg.innerHTML = __("Mail sent.");
+										msg.className = 'alert alert-success';
+									} else {
+										msg.innerHTML = reply.error;
+										msg.className = 'alert alert-danger';
+									}
+
+									msg.show();
+								})
+							}
+						</script>
+
+						<?= \Controls\hidden_tag("op", "pref-system") ?>
+						<?= \Controls\hidden_tag("method", "sendTestEmail") ?>
+
+						<fieldset>
+							<label><?= __("To:") ?></label>
+							<?= \Controls\input_tag("mail_address", "", "text", ['required' => 1]) ?>
+							<?= \Controls\submit_tag(__("Send test email")) ?>
+							<span style="display: none; margin-left : 10px" class="alert alert-error" id="mail-test-result">...</span>
+						</fieldset>
+					</form>
+				</div>
+			</div>
 			<div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">info</i> <?= __('PHP Information') ?>'>
 					<script type='dojo/method' event='onSelected' args='evt'>
 						if (this.domNode.querySelector('.loading'))