首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用sendmail.exe的php

使用sendmail.exe的php
EN

Stack Overflow用户
提问于 2009-05-02 23:00:24
回答 4查看 4.8K关注 0票数 0

我在本地主机windows上使用XAMPP VISTA m/c.使用gmail作为smpt服务器

我试图用简单的PHP脚本发送电子邮件

下面是sendmail.ini的配置细节(我在该目录中有sendmail.exe和其他2个dll )。

代码语言:javascript
复制
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"

一旦我调用脚本,它就会进入waiting...for本地主机.这是debug.log..。

09/05/02 17:34:41 ** -信息开始- 09/05/02 17:34:41 ** To: 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/0217:34:41 **名称: xxx 09/05/02 17:34:41 *电子邮件: xxx@yahoo.com 09/05/02 17:34:41 **消息:嘿测试讯息09/05/02 17:34* 09/05/02 17:34:41 * 09/05/02 17:34:41 ** 05/02 17:34:41 **结束- 09/05/02 17:34:41 **连接到smtp.gmail.com:465 09/05/02 17:34:41 **已连接。

我是PHP的新手,我想知道是否有更好的方式来处理邮件.我现在不喜欢带有附件的HTML/多部分邮件。而且,如果没有安装SMTP服务器,我应该能够在本地主机上进行测试。现在我想使用GMAIL进行测试。THnks

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2009-05-02 23:37:16

我强烈建议你使用一个库,例如PHPMailer。这是他们的gmail示例

另一个很好的库(我还没有使用)是SwiftMailer。这是他们的gmail示例

票数 1
EN

Stack Overflow用户

发布于 2009-05-02 23:06:43

GMAIL需要SSL afaik。

免费的(而且可能是“好的”) php邮件库,我知道邮件斯威夫特梅尔

票数 0
EN

Stack Overflow用户

发布于 2009-05-02 23:24:34

你也应该向你的ISP查询。为了防止垃圾邮件,他们中的许多人封锁了端口25。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/815843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档