diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-11 11:36:22 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-11 11:36:22 +0100 |
commit | 0e4d522dd90eec52828cab5e2c1d0ba7ea6a8f27 (patch) | |
tree | d01e606b374fa60165866f401830eaa4e3c94a10 /lib | |
parent | b0ec38e2024846e29d382e2c0cdff2c408ad209f (diff) | |
parent | 0de43f1fbe20f6cb69d14e8b07efa1e72f852464 (diff) | |
download | nextcloud-server-0e4d522dd90eec52828cab5e2c1d0ba7ea6a8f27.tar.gz nextcloud-server-0e4d522dd90eec52828cab5e2c1d0ba7ea6a8f27.zip |
Merge pull request #7659 from owncloud/fix-7596
Fix 7596
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/mail.php | 5 | ||||
-rw-r--r-- | lib/private/share/mailnotifications.php | 23 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/private/mail.php b/lib/private/mail.php index 90c3e343199..9605290fe57 100644 --- a/lib/private/mail.php +++ b/lib/private/mail.php @@ -72,11 +72,8 @@ class OC_Mail { $mailo->From = $fromaddress; $mailo->FromName = $fromname;; $mailo->Sender = $fromaddress; - $a=explode(' ', $toaddress); try { - foreach($a as $ad) { - $mailo->AddAddress($ad, $toname); - } + $mailo->AddAddress($toaddress, $toname); if($ccaddress<>'') $mailo->AddCC($ccaddress, $ccname); if($bcc<>'') $mailo->AddBCC($bcc); diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index 360376294cc..45734818731 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -97,7 +97,7 @@ class MailNotifications { try { \OCP\Util::sendMail($to, $recipientDisplayName, $subject, $htmlMail, $this->from, $this->senderDisplayName, 1, $alttextMail); } catch (\Exception $e) { - \OCP\Util::writeLog('sharing', "Can't send mail to inform the user abaut an internal share: " . $e->getMessage() , \OCP\Util::ERROR); + \OCP\Util::writeLog('sharing', "Can't send mail to inform the user about an internal share: " . $e->getMessage() , \OCP\Util::ERROR); $noMail[] = $recipientDisplayName; } } @@ -109,23 +109,26 @@ class MailNotifications { /** * @brief inform recipient about public link share * - * @param string recipient recipient email address + * @param string $recipient recipient email address * @param string $filename the shared file * @param string $link the public link * @param int $expiration expiration date (timestamp) - * @return mixed $result true or error message + * @return array $result of failed recipients */ public function sendLinkShareMail($recipient, $filename, $link, $expiration) { $subject = (string)$this->l->t('%s shared »%s« with you', array($this->senderDisplayName, $filename)); list($htmlMail, $alttextMail) = $this->createMailBody($filename, $link, $expiration); - try { - \OCP\Util::sendMail($recipient, $recipient, $subject, $htmlMail, $this->from, $this->senderDisplayName, 1, $alttextMail); - } catch (\Exception $e) { - \OCP\Util::writeLog('sharing', "Can't send mail with public link: " . $e->getMessage(), \OCP\Util::ERROR); - return $e->getMessage(); + $rs = explode(' ', $recipient); + $failed = array(); + foreach ($rs as $r) { + try { + \OCP\Util::sendMail($r, $r, $subject, $htmlMail, $this->from, $this->senderDisplayName, 1, $alttextMail); + } catch (\Exception $e) { + \OCP\Util::writeLog('sharing', "Can't send mail with public link to $r: " . $e->getMessage(), \OCP\Util::ERROR); + $failed[] = $r; + } } - - return true; + return $failed; } /** |