我XAMPP
在 localhost windows VISTA
m/c 上使用...使用 gmail 作为 smpt 服务器
我正在尝试使用简单的 PHP 脚本发送电子邮件
这是sendmail.ini
(我sendmail.exe
在该目录中有另外两个 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 ** --- 消息开始 --- 09/05/02 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 09/05/02 17 :34:41 ** 09/05/02 17:34:41 ** 姓名:xxx 09/05/02 17:34:41 ** 电子邮件:xxx@yahoo.com 09/05/02 17:34 :41 ** 消息:嘿测试消息 09/05/02 17:34:41 ** 09/05/02 17:34:41 ** 09/05/02 17:34:41 ** --- 消息结束--- 09/05/02 17:34:41 ** 连接到 smtp.gmail.com:465 09/05/02 17:34:41 ** 已连接。
我是新手PHP
,想知道是否有更好的方式来处理邮件...我现在不接受带有附件的 HTML/多部分邮件...此外,我应该能够在没有SMTP
安装服务器的情况下在 localhost 中进行测试。我想GMAIL
用于现在的测试。谢谢