Jump to content

automated email reply for forgot password


gongpex

Recommended Posts

Hello everyone,

 

I think website will be flaw if there is not this feature,

 

Q : what I must do so that I can have this feature?

 

note : I had try to using PHP email form to make this, but that's useless

 

please help me

 

thanks

Link to comment
Share on other sites

You generate a long random number or character string. You build an email to the user with the random number appended to a link to a password recovery page. You send the email to the user. You store the random number in a database table for that user along with an expiration datetime (allow perhaps 24 hours). In the password recovery page you establish a session and have $_GET code which reads the random number and checks it against the database. If the random number is valid the page presents the user with an opportunity to enter a new password.

Link to comment
Share on other sites

thanks before,

 

but this is not what I was mean,

 

I think I need to start from beginning,

<?php$to = "gong@gmail.com";$subject = "My subject";$txt = "Hello world!";$headers = "From: webmaster@example.com" . "rn" ."CC: somebodyelse@example.com";mail($to,$subject,$txt,$headers);?> 

this code just sample,

 

my Question actually :

 

Q : Why when I try to send message to email (on field to gong@gmail.com), the subject, and message not deliver on my email?

(when I open my gmail account there is no message about this)

 

Q2 : What I need to deliver this message to actual email?

 

please help

 

thanks

 

 

Link to comment
Share on other sites

Hello,

 

I had try to send email using code that I got from w3schools :

<?php// display form if user has not clicked submitif (!isset($_POST["submit"])) {  ?>  <form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">  From: <input type="text" name="from"><br>  Subject: <input type="text" name="subject"><br>  Message: <textarea rows="10" cols="40" name="message"></textarea><br>  <input type="submit" name="submit" value="Submit Feedback">  </form>  <?php} else {    // the user has submitted the form  // Check if the "from" input field is filled out  if (isset($_POST["from"])) {    $from = $_POST["from"]; // sender    $subject = $_POST["subject"];    $message = $_POST["message"];    // message lines should not exceed 70 characters (PHP rule), so wrap it    $message = wordwrap($message, 70);    // send mail    mail("gong@gmail.com",$subject,$message,"From: $fromn");    echo "Thank you for sending us feedback";  }}?>

I put this file on my hosting, and then I try to send into gong@gmail.com

 

but I didn't receive anything message from this.

 

btw, I don't understand with :

 

Make sure you're testing that on a server that can actually send email.

 

Q : Where usually I can found this server?

 

please help

 

thanks

Link to comment
Share on other sites

Ask your hosting service.

 

A : I had ask to them, and they told me if I use free hosting (subdomain) I cannot use that feature.

 

Or you can install a sendmail application locally, I use postfix on my Mac.

 

Q : If I install this (postfix) can I use it from hosting online (so that user can send email) or only can be used from localhost?

or Is there another solution?

 

please help

 

Thanks

Edited by gong
Link to comment
Share on other sites

it would only be for local testing as most hosts support sendmail functionality. That doesn't appear to be the case with your hosting though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...