SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令 [英] SMTP server response: 530 5.7.0 Must issue a STARTTLS command first

查看:41
本文介绍了SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令

SMTP server response: 530 5.7.0 Must issue a STARTTLS command first

当我在 php 脚本文件中使用 mail() 函数时收到此错误消息...

I get this error message when i use mail() function in php script file...

我使用的是 gmail SMTP 服务器,而 gmail 使用的是安全 SSL 的 STARTTLS我已经在我的contact.php文件中使用了这些命令

I m using gmail SMTP server and gmail using STARTTLS which is secure SSL and i already use these commands in my contact.php file

ini_set("SMTP","smtp.gmail.com");
ini_set("sendmail_from","<email-address>@gmail.com>");

那么我可以使用什么命令来启用 STARTTLS 或在 php,ini 文件中配置??

so what command i can use to enable STARTTLS or configure in php,ini file??

推荐答案

首先,确保您的 PHP 安装支持 SSL(在 phpinfo() 的输出中查找openssl"部分).

First, make sure you PHP installation has SSL support (look for an "openssl" section in the output from phpinfo()).

您可以在 PHP.ini 中设置以下设置:

You can set the following settings in your PHP.ini:

ini_set("SMTP","ssl://smtp.gmail.com");
ini_set("smtp_port","465");

这篇关于SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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