diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-07-21 05:08:19 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-07-21 05:08:19 -0400 |
commit | 289b64c94d7f477dc7939a616b51a9e2d350a885 (patch) | |
tree | a185f6a763e50e4693aa965b912fe3cba2423fa1 | |
parent | 98af7402c7d4b6fba268dcba7fd26fa285c413c6 (diff) |
fix mail sending
darcs-hash:20080721090819-84dde-34f1d1a0c448296e124c172d234976fd5cdad32c.gz
-rw-r--r-- | lib/mail.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/mail.php b/lib/mail.php index 73c8ae66b..8c5c7cf3d 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -170,11 +170,17 @@ function mail_broadcast_notice_sms($notice) { $cnt = $user->find(); while ($user->fetch()) { - mail_send_sms_notice($notice, $user); + $success = mail_send_sms_notice($notice, $user); + if (!$success) { + common_log(LOG_ERR, 'Could not send SMS message to user', __FILE__); + return false; + } } + + return true; } -function mail_send_notice($notice, $user) { +function mail_send_sms_notice($notice, $user) { $profile = $user->getProfile(); $name = $profile->getBestName(); $to = $name . ' <' . $user->smsemail . '>'; @@ -182,11 +188,12 @@ function mail_send_notice($notice, $user) { $headers = array(); $headers['From'] = $user->incomingemail; - $headers['To'] = $name . ' <' . $user->smsemail . '>'; + $headers['To'] = $to; $headers['Subject'] = sprintf(_('%s status'), $other->getBestName()); $body = $notice->content; - mail_send($user->smsemail, $headers, $body); + + return mail_send($user->smsemail, $headers, $body); } function mail_confirm_sms($code, $nickname, $address) { |