Есть код который должен отправлять письмо пользователю и админу сайта, но почему-то пользователю письмо приходит, а админу нет. Может что в коде не так?
// Send out e-mails
$admin_emails = array_map('trim', explode(',', $settings['admin_email']));
$html = html_entity_decode($settings['admin_message_' . $language], ENT_QUOTES, 'UTF-8');
$html = str_replace($replace, $with, $html);
$html = str_replace('[form_responses]', '<table>' . $admin_response_list . '</table>', $html);
$mail->setFrom(!empty($customer_emails) ? $customer_emails[0] : $admin_emails[0]);
$mail->setSender(!empty($customer_emails) ? $customer_emails[0] : str_replace(array(',', '&'), array('', 'and'), html_entity_decode($store_name, ENT_QUOTES, 'UTF-8')));
$mail->setSubject(str_replace($replace, $with, $settings['admin_subject_' . $language]));
$mail->setHtml($html);
$mail->setText(strip_tags($html));
foreach ($admin_emails as $email) {
$mail->setTo($email);
$mail->send();
}
if (!empty($customer_emails) && $settings['customer_email']) {
$html = html_entity_decode($settings['customer_message_' . $language], ENT_QUOTES, 'UTF-8');
$html = str_replace($replace, $with, $html);
$html = str_replace('[form_responses]', '<table>' . $customer_response_list . '</table>', $html);
$mail->setFrom($admin_emails[0]);
$mail->setSender(str_replace(array(',', '&'), array('', 'and'), html_entity_decode($store_name, ENT_QUOTES, 'UTF-8')));
$mail->setSubject(str_replace($replace, $with, $settings['customer_subject_' . $language]));
$mail->setHtml($html);
$mail->setText(strip_tags($html));
foreach ($customer_emails as $email) {
$mail->setTo($email);
$mail->send();
}
}