HOME > PHP > PHP Forum > Your password send successful. Send to mail : Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first in
Your password send successful. Send to mail : Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first in
Your password send successful.
Send to mail : [email protected]
Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first in C:\AppServ\www\PHP Forgot Lost Password\SendPassword.php on line 31
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorials</title>
</head>
<body>
<?php
mysql_connect("localhost","root","1234");
mysql_select_db("km");
$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."'
OR Email = '".trim($_POST['txtEmail'])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not Found Username or Email!";
}
else
{
echo "Your password send successful.<br>Send to mail : ".$objResult["email"];
$strTo = $objResult["txtEmail"];
$strSubject = "Your Account information username and password.";
$strHeader = "Content-type: text/html; charset=UTF-8\n"; // or UTF-8 //
$strHeader .= "From: [email protected]\nReply-To: [email protected]";
$strMessage = "";
$strMessage .= "Welcome : ".$objResult["Fname"]."<br>";
$strMessage .= "Username : ".$objResult["Username"]."<br>";
$strMessage .= "Password : ".$objResult["Password"]."<br>";
$strMessage .= "=================================<br>";
$strMessage .= "ThaiCreate.Com<br>";
$flgSend = mail($strTo,$strSubject,$strMessage,$strHeader);
}
mysql_close();
?>
</body>
</html>