[-] Classes : #PSCFI-4973 : Bug fix mail receiver was null

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15183 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fGaillard
2012-05-10 15:02:19 +00:00
parent 74f7841fae
commit 49c37d0d39
+4 -1
View File
@@ -133,6 +133,8 @@ class MailCore
if ($toName && is_array($toName) && Validate::isGenericName($toName[$key]))
$to_name = $toName[$key];
}
if ($to_name == null)
$to_name = $addr;
/* Encode accentuated chars */
$to_list->addTo($addr, '=?UTF-8?B?'.base64_encode($to_name).'?=');
}
@@ -141,6 +143,8 @@ class MailCore
} else {
/* Simple recipient, one address */
$to_plugin = $to;
if ($toName == null)
$toName = $to;
$to = new Swift_Address($to, '=?UTF-8?B?'.base64_encode($toName).'?=');
}
try {
@@ -230,7 +234,6 @@ class MailCore
if (isset($attachment['content']) && isset($attachment['name']) && isset($attachment['mime']))
$message->attach(new Swift_Message_Attachment($attachment['content'], $attachment['name'], $attachment['mime']));
}
/* Send mail */
$send = $swift->send($message, $to, new Swift_Address($from, $fromName));
$swift->disconnect();