summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2011-08-25 14:04:12 +0000
committerUrban Müller2011-08-25 14:04:12 +0000
commite030125946f2451ef63851dbd394d0811a447085 (patch)
tree674786b8c4e4a13ef08b914bfa2b677b11c26b73
parent6ffd0a623a699ca4b0beec640695696ed6083462 (diff)
downloaditools-e030125946f2451ef63851dbd394d0811a447085.tar.gz
itools-e030125946f2451ef63851dbd394d0811a447085.tar.bz2
itools-e030125946f2451ef63851dbd394d0811a447085.zip
catch failed mail deliveries
-rw-r--r--it_mail.class8
1 files changed, 6 insertions, 2 deletions
diff --git a/it_mail.class b/it_mail.class
index 33105a3..81a282f 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -179,7 +179,7 @@ function add_file($filename, $mimetype = "application/octet-stream", $name = '')
/**
* Send this email message
- * @return True if mail was sent
+ * @return True if mail was accepted for delivery
*/
function send()
{
@@ -287,7 +287,11 @@ function send()
}
if (it::is_live() || EDC('forcemail'))
- return mail($to, $this->header_escape($this->subject), $text, join("\n", $headers), $this->flags);
+ {
+ if (($result = mail($to, $this->header_escape($this->subject), $text, join("\n", $headers), $this->flags)) === false)
+ it::error(array('title' => 'failed sending mail', 'body' => D($to, $this->header_escape($this->subject), $text, $headers, $this->flags)));
+ return $result;
+ }
else
return ED($to, $this->header_escape($this->subject), $text, $headers, $this->flags);
}