简体   繁体   English

PHP SMTP 错误:SMTP 服务器响应:530 5.7.0

[英]PHP SMTP ERROR: SMTP server response: 530 5.7.0

I am getting a error我收到一个错误

Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first.警告:mail():SMTP 服务器响应:530 5.7.0 必须首先发出 STARTTLS 命令。 z10sm5799896oih.1 - gsmtp in C:\\wamp64\\www\\Change.php on line 47 z10sm5799896oih.1 - C:\\wamp64\\www\\Change.php 中的 gsmtp 第 47 行

I have googled it and cant find anything that has helped.我用谷歌搜索过它,找不到任何有帮助的东西。 I am not sure what to do next please help我不知道接下来要做什么,请帮忙

This is the code这是代码

<?php
// Connect to MySQL
$username = "*****"; 
$password = "*****"; 
$host = "*********"; 
$dbname = "*****"; 
try {
$conn = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password);
}
catch(PDOException $ex) 
{ 
    $msg = "Failed to connect to the database"; 
} 

// Was the form submitted?
if (isset($_POST["ForgotPassword"])) {

// Harvest submitted e-mail address
if (filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {
    $email = $_POST["email"];

}else{
    echo "email is not valid";
    exit;
}

// Check to see if a user exists with this e-mail
$query = $conn->prepare('SELECT email FROM user WHERE email = :email');
$query->bindParam(':email', $email);
$query->execute();
$userExists = $query->fetch(PDO::FETCH_ASSOC);
$conn = null;

if ($userExists["email"])
{
    // Create a unique salt. This will never leave PHP unencrypted.
    $salt = "498#2D83B631%3800EBD!801600D*7E3CC13";

    // Create the unique user password reset key
    $password = hash('sha512', $salt.$userExists["email"]);

    // Create a url which we will direct them to reset their password
    $pwrurl = "www.yoursitehere.com/reset_password.php?q=".$password;

    // Mail them their key
    $mailbody = "Dear user,\n\nIf this e-mail does not apply to you please ignore it. It appears that 
 you have requested a password reset at our website www.*****.com\n\nTo reset your password, please 
click the link below. If you cannot click it, please paste it into your web browser's address 
bar.\n\n" . $pwrurl . "\n\nThanks,\nThe Administration";



 **This is where the error is**
    mail($userExists["email"], "www.*****.com - Password Reset", $mailbody);





    echo "Your password recovery key has been sent to your e-mail address.";

}
else
    echo "No user with that e-mail address exists.";
}
?>

1. Trying doing telnet Using telnet command you can actually test whether the port is opened or not. 1. 尝试telnet使用telnet 命令可以实际测试端口是否打开。

try this:尝试这个:

//Type the following command to see if Port 25 is blocked on your network. 
telnet pepipost.com 25

If Port 25 is not blocked, you will get a successful 220 response (text may vary).如果端口 25 未被阻止,您将收到成功的 220 响应(文本可能会有所不同)。

Trying 202.162.247.93... 
Connected to pepipost.com. 
Escape character is '^]'. 
220 pepipost.com ESMTP Postfix

If Port 25 is blocked, you will get a connection error or no response at all.如果端口 25 被阻止,您将收到连接错误或根本没有响应。

Trying 202.162.247.93...
telnet: connect to address 202.162.247.93: Connection refused
telnet: Unable to connect to remote host

2. Use outPorts 2.使用outPorts
outPorts is a very good open-source on GitHub to which scans all your ports and gives the result. outPorts是 GitHub 上一个非常好的开源软件,它会扫描您所有的端口并给出结果。 Once outPorts is installed, you can type the following command in the terminal to check port 25 connectivity: outPorts 25安装 outPorts 后,您可以在终端中键入以下命令来检查端口 25 的连接性:outPorts 25

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 php mail函数错误 - &gt;警告:mail()[function.mail]:SMTP服务器响应:530 5.7.0必须先发出STARTTLS命令 - php mail function error -> Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令 - SMTP server response: 530 5.7.0 Must issue a STARTTLS command first SMTP服务器响应:530 5.7.57 - SMTP server response: 530 5.7.57 SMTP 服务器响应:530 5.7.0 必须首先发出 STARTTLS 命令。 Windows 7的 - SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. windows 7 WampServer:警告:mail():SMTP 服务器响应:530 5.7.0 必须先发出 STARTTLS 命令 - WampServer: Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first SMTP-&gt;错误:服务器未接受AUTH:530 5.7.0必须首先发出STARTTLS命令 - SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command first php邮件警告-SMTP服务器响应:530不允许中继 - php mail warning - SMTP server response: 530 Relaying not allowed 如何解决此错误( mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. i2sm7399406pjt.19 - gsmtp ) - How solve this error ( mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. i2sm7399406pjt.19 - gsmtp ) WAMP-SMTP服务器响应:要求530 SMTP身份验证 - WAMP - SMTP server response: 530 SMTP authentication is required SMTP 错误:MAIL FROM 命令失败:530 5.7.0 使用 PHPMailer 时必须先发出 STARTTLS 命令 - SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM