我有我的PHP一个问题:我想用XAMPP 我的配置发送简单的邮件php..I是: 的php.ini: 只有sendmail和mail.add_x_header没有评论发送邮件用PHP
; For Win32 only.
; http://php.net/smtp
;SMTP = smtp.gmail.com
; http://php.net/smtp-port
;smtp_port = 587
sendmail_path = "C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header = Off
sendmail.ini:
smtp_server=smtp.gmail.com
;smtp port (normally 25)
smtp_port=587
smtp_ssl=true
[email protected]
auth_password=mypassword
和index.php文件
<?php
$subject="Hi There!!";
$to="[email protected]";
$body="This is my demo email sent using PHP on XAMPP";
if (mail($to,$subject,$body))
echo "Mail sent successfully!";
else
echo "Mail not sent!";
?>
它运行没有错误,但邮件不来...我的错误在哪里?PLIZ帮助我
您是否有防火墙问题?你有没有检查你的PHP日志? –
你确定你php.ini'sendmail_path =“C:\ xampp \ sendmail \ sendmail.exe \”-t“'看起来不错吗?我怀疑你有一个不平衡的报价或一些非反斜杠!试试'sendmail_path = C: /xampp/sendmail/sendmail.exe -t' –
给这个帖子试一试:[这里](http://stackoverflow.com/questions/4948687/xampp-sendmail-using-gmail-account) – MikeF