PHP和mail()函数

时间:2015-08-17 09:03:05

标签: php

我正在使用PHP脚本将电子邮件发送给朋友列表。这曾经成功运作,但现在唯一成功发送的电子邮件是我域内的电子邮件(" mycompany.com")。我域外的任何电子邮件都无法发送。这是权限问题吗?我可以通过更改我在调用mail()函数时使用的标题来修复它吗?这是PHP脚本:

$name = "Joe Smith";
$email = "jsmith@mycompany.com";
$to = "ajones@mycompany.com, tom@abc.com, ted@def.com, mary@ghi.com";
$subject = "Dinner Invitations";
$message = "Invitation to Dinner";
$headers  = "From: ".$name."<".$email.">\r\n";
$headers .= "Reply-To: ".$email."\r\n";
$headers .= "Return-Path: ".$email."\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
$headers .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n";
mail($to, $subject, $message, $headers);

服务器仅发送了ajones@mycompany.com。没有发送tom@abc.com,ted @ def.com和mary@ghi.com。

任何建议都将深表感谢!

0 个答案:

没有答案