Jump to content

script is not working n does not show any error,warning,notice


shwetapandit

Recommended Posts

this is my file in PHPMailer/test folder location.Plz help

 

 <?php

$email = $_POST["email"];
$pattern = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z])/';
$email_test = preg_match("$pattern", $email);

if($email_test){
    include("settings.php"); //FILE WITH THE IMPORTANT MySQL INFORMATION
require_once "C:\wamp\www\PHPMailer_5.2.4/class.phpmailer.php";
$mailer = new PHPMailer();
$mailer->IsSMTP();

$mailer->Host = "smtp.gmail.com:587";
$mailer->SMTPsecure='tls';
$mailer->SMTPAuth = TRUE;
$mailer->Username = "[email protected]";  // Change this to your gmail adress
$mailer->Password = "pass";  // Change this to your gmail password
$mailer->From = "[email protected]";  // This HAVE TO be your gmail adress
$mailer->FromName = "you temporary password"; // This is the from name in the email, you can put anything you like here
$mailer->Body = "This is the your temporary password";
$mailer->Subject = "Temporary password";
$q = mysql_query("SELECT * FROM simple_login WHERE email='".$email."'");
    $n = mysql_num_rows($q);
    $r = mysql_fetch_assoc($q);

$mailer->headers = "From: Your Site \r\n";
$mailer->headers.= "Content-type: text/html\r\n";
$mailer->message = "You have requested that you forgot your password.<br>
                    Password: <b>".$r["password"]."<b>";
$mailer->AddAddress("$email");  // This is where you put the email adress of the person you want to mail
if(!$mailer->Send())
{
echo  invalid Email<br/ >';
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo 'Password sent to <b>'.$email.'</b>';;
}
?>


 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.