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 = "abc@gmail.com";  // Change this to your gmail adress
$mailer->Password = "pass";  // Change this to your gmail password
$mailer->From = "abc@gmail.com";  // 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>';;
}
?>


 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.