发送内部电子邮件

时间:2013-03-21 12:00:31

标签: php sendmail swiftmailer

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=<myaddress@whateveritis.com>, ctladdr=<apache@localhost.localdomain> (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=<myaddress@whateveritis.com>, ctladdr=<apache@localhost.localdomain> (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=<myaddress@whateveritis.com>, ctladdr=<apache@localhost.localdomain> (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=<201303211219.r2LCJcKD015229@localhost.localdomain>, relay=apache@localhost
Mar 21 12:19:39 database sendmail[15230]: r2LCJdfM015230: from=<apache@localhost.localdomain>, size=357, class=0, nrcpts=1, msgid=<201303211219.r2LCJcKD015229@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Mar 21 12:19:39 database sendmail[15229]: r2LCJcKD015229: to=myaddress@whateveritis.com, 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 个答案:

答案 0 :(得分:1)

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