2013-03-21 58 views
3

CODE:以上发送内部电子邮件

$from = $_GET['from']; 
$to = $_GET['to']; 
$headers = "From:" . $from; 
mail($to, 'PHP mail() function', 'Coming from PHP mail() function', $headers); 
echo 'Check your inbox for PHP mail() function'; 

代码用来发送电子邮件本地,但不再工作。只适用于发送外部电子邮件。另外,swift_emailer()也不起作用。

更多细节:

坐落在:

/usr/sbin/sendmail 

phpinfo()函数输出:

sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i 

MAIL LOG:

Mar 21 12:18:27 database sendmail[15156]: r2LCEFfB015154: to=<[email protected]>, ctladdr=<[email protected]> (48/48), delay=00:04:12, xdelay=00:04:12, mailer=esmtp, pri=120357, relay=mx00.1and1.co.uk. [212.227.15.134], dsn=5.0.0, stat=Service unavailable 
Mar 21 12:18:27 database sendmail[15156]: r2LCEFfB015154: r2LCIRfB015156: DSN: Service unavailable 
Mar 21 12:18:27 database sendmail[15156]: r2LCIRfB015156: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31619, dsn=2.0.0, stat=Sent 
Mar 21 12:18:32 database sendmail[15162]: r2LCENGr015160: to=<[email protected]>, ctladdr=<[email protected]> (48/48), delay=00:04:09, xdelay=00:04:08, mailer=esmtp, pri=120356, relay=mx01.1and1.co.uk. [212.227.17.175], dsn=5.0.0, stat=Service unavailable 
Mar 21 12:18:32 database sendmail[15162]: r2LCENGr015160: r2LCIWGr015162: DSN: Service unavailable 
Mar 21 12:18:32 database sendmail[15162]: r2LCIWGr015162: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31618, dsn=2.0.0, stat=Sent 
Mar 21 12:18:50 database sendmail[15166]: r2LCEk12015164: to=<[email protected]>, ctladdr=<[email protected]> (48/48), delay=00:04:04, xdelay=00:04:04, mailer=esmtp, pri=120357, relay=mx01.1and1.co.uk. [212.227.15.134], dsn=5.0.0, stat=Service unavailable 
Mar 21 12:18:50 database sendmail[15166]: r2LCEk12015164: r2LCIo12015166: DSN: Service unavailable 
Mar 21 12:18:50 database sendmail[15166]: r2LCIo12015166: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31619, dsn=2.0.0, stat=Sent 
Mar 21 12:19:39 database sendmail[15229]: r2LCJcKD015229: from=apache, size=123, class=0, nrcpts=1, msgid=<[email protected]>, [email protected] 
Mar 21 12:19:39 database sendmail[15230]: r2LCJdfM015230: from=<[email protected]>, size=357, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] 
Mar 21 12:19:39 database sendmail[15229]: r2LCJcKD015229: [email protected], ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30123, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r2LCJdfM015230 Message accepted for delivery) 
+1

当你尝试时会发生什么?信息消失了吗?你是否收到来自邮件服务器的退回邮件?有没有错误?你的HTTP服务器日志说什么?你的sendmail日志说什么? – Quentin 2013-03-21 12:11:56

+0

出于好奇,如果您将'$ from'更改为外部电子邮件地址,它会起作用吗?你检查过SPAM文件夹吗? – jnthnjns 2013-03-21 12:12:39

+0

@Quentin - 没有错误,没有布鲁斯,日志添加上面。 – BentCoder 2013-03-21 12:26:26

回答

1

您是否与您的托管公司检查过,看他们是否在服务器上实施了内部邮件系统?什么东西可以捕捉邮件并在本地传递而不会让它离开服务器?如果你检查你的目录,它通常是一个像/ Mail或类似的文件夹。

+0

刚刚发现他们有一个越野车规则或任何它阻止正常传入和传出的邮件。现在工作。 – BentCoder 2013-04-09 09:17:13

+1

@MadMax,我有同样的问题。你能否详细说明你是如何找到解决方案的? – zbinsd 2014-02-18 08:05:03

+0

@zbinsd - 抱歉,我刚刚看到您的消息。托管公司对它们进行了整理,我没有做任何事情。无论如何,我希望你已经整理过了。 – BentCoder 2014-10-25 23:47:46