【发布时间】:2010-10-23 09:13:27
【问题描述】:
我在本地主机窗口上使用XAMPP VISTA m/c...使用 gmail 作为 smpt 服务器
我正在尝试使用简单的 PHP 脚本发送电子邮件
这是sendmail.ini 的配置详细信息(我在该目录中有sendmail.exe 和另外2 个dll)
smtp_server=smtp.gmail.com
; smtp port (normally 25)
smtp_port=465
; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify
default_domain=localhost
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
auth_username=xxxxxxx
auth_password=xxxxxx
hostname=localhost
and I have changed the php.ini
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from = xxxxx
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
一旦我调用脚本,它就会进入等待...等待本地主机... 这是 debug.log...
09/05/02 17:34:41 ** --- 消息开始 --- 2002 年 9 月 5 日 17:34:41 ** 至:xxx@yahoo.com 09/05/02 17:34:41 ** 主题:表格提交结果 09/05/02 17:34:41 ** 来自:我的网站 09/05/02 17:34:41 ** 回复:xxx@gmail.com 2002 年 9 月 5 日 17:34:41 ** 09/05/02 17:34:41 ** 姓名:xxx 2002 年 9 月 5 日 17:34:41 ** 电子邮件:xxx@yahoo.com 09/05/02 17:34:41 ** 消息:嘿测试消息 2002 年 9 月 5 日 17:34:41 ** 2002 年 9 月 5 日 17:34:41 ** 09/05/02 17:34:41 ** --- 消息结束 --- 09/05/02 17:34:41 ** 连接到 smtp.gmail.com:465 2002 年 9 月 5 日 17:34:41 ** 已连接。
我是PHP 的新手,想知道是否有更好的邮件发送方式...我现在不接受带有附件的 HTML/多部分邮件...
此外,我应该能够在没有安装 SMTP 服务器的情况下在 localhost 中进行测试。我现在想使用GMAIL 进行测试。
谢谢
【问题讨论】:
标签: php email sendmail.exe