Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SMTP无法通过phpmailer进行连接。根据下面的代码 函数validate_(){ if((document.getElementById(“用户登录名”).value==“”)和&(document.getElementById(“用户电子邮件”).value==“”){ document.getElementById(“验证消息”).innerHTML=“需要登录名或电子邮件!” 返回false; } 返回真值 } 忘记密码了? 用户名 或 电子邮件_Php_Email - Fatal编程技术网

SMTP无法通过phpmailer进行连接。根据下面的代码 函数validate_(){ if((document.getElementById(“用户登录名”).value==“”)和&(document.getElementById(“用户电子邮件”).value==“”){ document.getElementById(“验证消息”).innerHTML=“需要登录名或电子邮件!” 返回false; } 返回真值 } 忘记密码了? 用户名 或 电子邮件

SMTP无法通过phpmailer进行连接。根据下面的代码 函数validate_(){ if((document.getElementById(“用户登录名”).value==“”)和&(document.getElementById(“用户电子邮件”).value==“”){ document.getElementById(“验证消息”).innerHTML=“需要登录名或电子邮件!” 返回false; } 返回真值 } 忘记密码了? 用户名 或 电子邮件,php,email,Php,Email,mailconfiguration.php <?php if(!empty($_POST["forgot-password"])){ $conn = mysqli_connect("localhost", "root", "12345", "omar_wacoa"); $condition = ""; if(!empty($_POST["user-login-name"])) $condition = " ku_id = '" . $_POST["user-login-name"

mailconfiguration.php

    <?php
if(!empty($_POST["forgot-password"])){
$conn = mysqli_connect("localhost", "root", "12345", "omar_wacoa");
$condition = "";
if(!empty($_POST["user-login-name"])) 
$condition = " ku_id = '" . $_POST["user-login-name"] . "'";
if(!empty($_POST["user-email"])) {
if(!empty($condition)) {
$condition = " and ";
}
$condition = " email = '" . $_POST["user-email"] . "'";
}
if(!empty($condition)) {
$condition = " where " . $condition;
}
$sql = "Select * from user " . $condition;
$result = mysqli_query($conn,$sql);
$user = mysqli_fetch_array($result);
if(!empty($user)) {
echo "hello";
require_once("forgot-password-recovery-mail.php");
} else {
$error_message = 'No User Found';
}
    }
?>
<link href="demo-style.css" rel="stylesheet" type="text/css">
<script>
function validate_forgot() {
    if((document.getElementById("user-login-name").value == "") && (document.getElementById("user-email").value == "")) {
        document.getElementById("validation-message").innerHTML = "Login name or Email is required!"
        return false;
    }
    return true
}
</script>
<form name="frmForgot" id="frmForgot" method="post" onSubmit="return validate_forgot();">
<h1>Forgot Password?</h1>
<?php if(!empty($success_message)) { ?>
<div class="success_message"><?php echo $success_message; ?></div>
<?php } ?>
<div id="validation-message">
<?php if(!empty($error_message)) { ?>
<?php echo $error_message; ?>
<?php } ?>
</div>
<div class="field-group">
<div><label for="username">Username</label></div>
<div><input type="text" name="user-login-name" id="user-login-name" class="input-field"> Or</div>
</div>  
<div class="field-group">
<div><label for="email">Email</label></div>
<div><input type="text" name="user-email" id="user-email" class="input-field"></div>
</div>
<div class="field-group">
<div><input type="submit" name="forgot-password" id="forgot-password" value="Submit" class="form-submit-button"></div>
    </div>  
</form>

忘记-password-recovery-mail.php

<?php
define("PROJECT_HOME","http://localhost/wacoa_f");
define("PORT","587"); // port number
define("MAIL_USERNAME", "user@gmail.com"); // smtp usernmae
define("MAIL_PASSWORD", "ffdg"); // smtp password
define("MAIL_HOST", "smtp.gmail.com"); // smtp host
define("MAILER", "smtp");
define("SENDER_NAME", "Admin");
define("SERDER_EMAIL", "admin@admin.com");
?>

在这里,我试图提交一个带有恢复电子邮件的表单,该表单发送一个链接以重置用户的密码。我有用户PHPMailer。但它给我的错误如下:

2017-11-21 06:48:03客户端->服务器:EHLO本地主机
2017-11-21 06:48:03客户端->服务器:STARTTLS
SMTP错误:无法连接到SMTP主机。
2017-11-21 06:48:04客户端->服务器:退出
2017-11-21 06:48:04
SMTP连接()失败


在mail configuration.php上,它应该是define(“SENDER\u EMAIL”admin@admin.com"); 不是

定义(“SERDER_电子邮件”admin@admin.com"); & on-password-recovery-mail.php

<?php
define("PROJECT_HOME","http://localhost/wacoa_f");
define("PORT","587"); // port number
define("MAIL_USERNAME", "user@gmail.com"); // smtp usernmae
define("MAIL_PASSWORD", "ffdg"); // smtp password
define("MAIL_HOST", "smtp.gmail.com"); // smtp host
define("MAILER", "smtp");
define("SENDER_NAME", "Admin");
define("SERDER_EMAIL", "admin@admin.com");
?>
在//sender下面,这两行应该是sender,而不是SERDER
它的语法错误,否则它应该可以工作,因为我昨天在mail configuration.php上测试了它,它应该是define(“SENDER\u EMAIL”admin@admin.com"); 不是

定义(“SERDER_电子邮件”admin@admin.com"); & on-password-recovery-mail.php

<?php
define("PROJECT_HOME","http://localhost/wacoa_f");
define("PORT","587"); // port number
define("MAIL_USERNAME", "user@gmail.com"); // smtp usernmae
define("MAIL_PASSWORD", "ffdg"); // smtp password
define("MAIL_HOST", "smtp.gmail.com"); // smtp host
define("MAILER", "smtp");
define("SENDER_NAME", "Admin");
define("SERDER_EMAIL", "admin@admin.com");
?>
在//sender下面,这两行应该是sender,而不是SERDER
它的语法错误,否则它应该可以工作,因为我昨天测试过它

你应该正确缩进你的代码。这将帮助我们和您遵循流程并调试代码。现在,它很难阅读。我确实看到的一件事是,您对查询非常开放,应该真正使用而不是连接查询。特别是因为你根本没有逃避用户的输入!尝试使用
$mail->SMTPSecure=“ssl”
和PORT=465ALERT立即删除您的问题,将您的用户名和密码更改为dummy in code,然后重新发布您的问题。不要与任何人共享用户名和密码。这不起作用。我已经尝试过了。你应该正确缩进你的代码。这将帮助我们和您遵循流程并调试代码。现在,它很难阅读。我确实看到的一件事是,您对查询非常开放,应该真正使用而不是连接查询。特别是因为你根本没有逃避用户的输入!尝试使用
$mail->SMTPSecure=“ssl”
和PORT=465ALERT立即删除您的问题,将您的用户名和密码更改为dummy in code,然后重新发布您的问题。不要与任何人共享用户名和密码。它不起作用。我已经尝试过了