SMTP服务器本地发送邮件php [英] SMTP server local send mail php

查看:262
本文介绍了SMTP服务器本地发送邮件php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
mail():SMTP服务器响应:550地址在hmailserver上无效错误

Possible Duplicate:
mail(): SMTP server response: 550 The address is not valid error on hmailserver

我想测试我的类senderMail.php.

I would like test my class senderMail.php.

要使用smtp服务器,我使用hMailServer.我已经创建了域,已经创建了帐户,现在配置SMTP设置.

For to have, a smtp server, I use hMailServer. I have created a domaine, I have created a account, and now I configure SMTP settings.

hMailServer需要配置"SMTP RELAYER".我测试以下信息: smtp.gmail.com在端口587上,我也输入了标识符.

hMailServer would like a configuration "SMTP RELAYER". I test with the information: smtp.gmail.com on port 587 and I enter my identifier too.

何时,我已使用我的类senderMail.php测试了此错误:

When, I have tested this with my class senderMail.php I have this error:

SMTP服务器响应:550地址无效

SMTP server response: 550 The address is not valid

我的错误出在哪里?是来自SMTP RELAYER还是其他配置?

Where come my error ? It's from SMTP RELAYER or a other config ?

推荐答案

为什么不尝试直接从本地主机发送它.

why don't you try it to send it directly from localhost.

  1. 转到您的php.ini文件并更改SMTP = localhost to SMTP = aspmx.l.google.com并取消注释sendmail_from并放入您的发送Gmail地址.

  1. Go to your php.ini file and change SMTP = localhost to SMTP = aspmx.l.google.com and uncomment sendmail_from and put in your sending gmail address.

在php中,用mail("youremail]@gmail.com", "subject", "body");

注意:该功能仅在将电子邮件发送到Google托管的电子邮件地址时有效.

Note: This only works when sending email to google hosted email addresses.

OR

如果上面的命令不起作用,请尝试使用 swiftmailer 其php邮件发送库,该库也允许通过SMTP发送邮件在开发过程中真的很有帮助.

try above if its not work use swiftmailer its php mail sending library which also allow to send mail through SMTP its really helpful during development.

这篇关于SMTP服务器本地发送邮件php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆