我已经使用phpmailer一段时间了,现在我注意到所有其他to
地址条目(附加$mail->addAddress
或$mail->addCC
或$mail->addBCC
都引起了返回的页面:
Could not instantiate mail function.
该页面仅使用一个地址即可正常工作。我在Windows 2012服务器上使用它。我已经找到了对那些在Win32上不起作用的功能的引用,但是它们曾经起作用。有什么想法吗?
require 'autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail -> CharSet = "UTF-8";
$firstname=$_GET['firstname'];
$lastname=$_GET['lastname'];
$email=$_GET['email'];
$phone=$_GET['phone'];
$mail->setFrom('news@imj.org.il', 'News');
$mail->addReplyTo('news@imj.org.il', 'News');
$mail->addAddress('webmaster@imj.org.il', 'Webmaster');
$mail->addAddress('news@imj.org.il', 'News'); /****This doesn't work****/
$mail->addBCC('news@gmail.com');/****This doesn't work****/
$mail->isHTML(true);
$mail->Subject = "Friends Registration";
$mail->Body = "First Name: ".$firstname . "<br>\r\n ";
$mail->Body .= "Last Name: ".$lastname . "<br>\r\n ";
$mail->Body .= "Email: " . $email . "<br>\r\n ";
$mail->Body .= "Tel: " . $phone . "<br>\r\n ";
$mail->AltBody = $firstname." " .$lastname." " . $email;
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
答案 0 :(得分:0)
好吧,现在我看到问题出在邮件服务器上,它也没有发送多个电子邮件地址,所以我想这与phpMailer无关。当我尝试发送多地址邮件时,这是日志: PHP警告:mail():SMTP服务器响应:550 5.7.64 TenantAttribution;在第14行的E:\ site \ temp \ simplemail.php中拒绝中继访问[DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com]