Skip to content

Commit

Permalink
Fixed issue #5474: Not possible to send a token to multiple email add…
Browse files Browse the repository at this point in the history
…resses

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@11227 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 20, 2011
1 parent 38c0fa5 commit 1e70252
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions common_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4216,7 +4216,7 @@ function ReplaceFields ($text,$fieldsarray, $bReplaceInsertans=false)
* @param mixed $mail This is an PHPMailer object. If null, one will be created automatically and unset afterwards. If supplied it won't be unset.
* @param string $body Body text of the email in plain text or HTML
* @param mixed $subject Email subject
* @param mixed $to
* @param mixed $to Array with several email addresses or single string with one email address
* @param mixed $from
* @param mixed $sitename
* @param mixed $ishtml
Expand All @@ -4229,7 +4229,9 @@ function SendEmailMessage($mail, $body, $subject, $to, $from, $sitename, $ishtml

global $emailmethod, $emailsmtphost, $emailsmtpuser, $emailsmtppassword, $defaultlang, $emailsmtpdebug;
global $rootdir, $maildebug, $maildebugbody, $emailsmtpssl, $clang, $demoModeOnly, $emailcharset;

if (!is_array($to)){
$to=array($to);
}
if (!is_array($customheaders) && $customheaders == '')
{
$customheaders=array();
Expand Down Expand Up @@ -4322,8 +4324,7 @@ function SendEmailMessage($mail, $body, $subject, $to, $from, $sitename, $ishtml

$mail->SetFrom($fromemail, $fromname);
$mail->Sender = $senderemail; // Sets Return-Path for error notifications
$toemails = explode(";", $to);
foreach ($toemails as $singletoemail)
foreach ($to as $singletoemail)
{
if (strpos($singletoemail, '<') )
{
Expand Down

0 comments on commit 1e70252

Please sign in to comment.