我在我的Ubuntu Server 12.04.1上安装了sendmail。我无法从我的域发送电子邮件(例如:www.mydomain.com),我在电子邮件日志中看不到任何错误。我试图在php.ini中更新路径,如下所示
sendmail_path = / usr / sbin / sendmail -t -i
此外:
sendmail_path = / usr / sbin / sendmail
我用来发送电子邮件的PHP脚本(mydomain只是一个例子,我有一个真正的域名)。以下代码的结果:“电子邮件未发送”。
<!DOCTYPE HTML>
<?php header("Content-type: text/html; charset=utf-8") ?>
<?php
$subject = 'Test Mail Subject';
$message = 'Test Mail Body';
$to = 'anabash35@gmail.com';
if(@mail($to, $subject, $message, "noreply@mydomain.org")){
echo 'email sent';
}
else{
echo 'email not sent';
}
?>
在电子邮件日志(nano /var/log/mail.log)中,我得到以下内容(我没有注意到任何错误,我的服务器名称是server1):
Oct 7 02:01:57 server1 sm-mta [4333]:r94L05At005852:to =,ctladdr =(33/33),delay = 2 + 03:01:52,xdelay = 00:00:00,邮件程序= ESMTP,$
Oct 7 02:01:57 server1 sm-mta [4333]:r94MqOUW005456:to =,ctladdr =(33/33),delay = 2 + 01:09:32,xdelay = 00:00:00,邮件程序= ESMTP,$
Oct 7 02:01:57 server1 sm-mta [4333]:r94MqNA8005453:to =,ctladdr =(33/33),delay = 2 + 01:09:34,xdelay = 00:00:00,邮件程序= ESMTP,$
Oct 7 02:01:57 server1 sm-mta [4333]:r94M7xbi005307:to =,ctladdr =(33/33),delay = 2 + 01:53:58,xdelay = 00:00:00,邮件程序= ESMTP,$
我没有触及任何配置文件,如sendmail.mc或sendmail.cf等。
我尝试重启服务:service sendmail restart。但没有运气:(
请您告诉我该怎么做以及如何调试问题?非常感谢。
干杯!