我正在使用PHPMailer从服务器发送电子邮件,它一直运行良好。我们最近将网站从Windows Server 2012移至Mac OS X 10.10。Mac OS X上的PHPMailer和CC地址
我遇到麻烦CC收件人现在的工作,它的Mac OS X上运行
我添加抄送收件人从一个数组:
foreach($ccRecipients as $ccRecipient)
{
$mail->AddCC($ccRecipient);
}
正在发送的电子邮件,但没有CC地址被包括在内 - 看起来它们以某种方式被转换成BCC地址,因为它们的电子邮件被传送到CC地址,但它们没有在CC地址部分列出。查看PHPMailer文档的AddCC功能,它提到“注意:该功能可以在win32上使用SMTP邮件程序,而不是”邮件“邮件程序。我收集这意味着它不会在OS X上工作?
如果那是真的,我有什么办法可以解决这个问题,并且仍然在OS X上包含使用PHPMailer的CC电子邮件地址?下面是发送电子邮件一些简单的代码:
require('inc/phpMailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->AddAddress('[email protected]');
$mail->AddCC('[email protected]');
$emailSubject = 'Testing PHP Mailer';
$emailBody = 'Quick manual test of the PHP Mailer';
$mail->From = '[email protected]';
$mail->FromName = 'Acme Widgets';
$mail->IsHTML(true);
$mail->Subject = $emailSubject;
$mail->Body = $emailBody;
if(!$mail->Send()) {
$sendEmailError = 'There was an error sending the status email: '. $mail- >ErrorInfo;
echo $sendEmailError;
} else {
$sendEmailError = '';
}
添加完整的发送邮件代码 –