解决使用自带Email类发送邮件时,收件人账号名是数组索引的问题

pull/286/head
Henry 2021-03-02 13:44:37 +08:00
parent af241c7c21
commit 5ab531e0ec
1 changed files with 6 additions and 1 deletions

View File

@ -176,7 +176,12 @@ class Email
*/
protected function buildAddress($emails)
{
$emails = is_array($emails) ? $emails : array_flip(explode(',', str_replace(";", ",", $emails)));
if (!is_array($emails)) {
$emails = array_flip(explode(',', str_replace(";", ",", $emails)));
foreach ($emails as $key => $value) {
$emails[$key] = strstr($key, '@', true);
}
}
return $emails;
}