gongpex Posted June 1, 2014 Share Posted June 1, 2014 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 More sharing options...
davej Posted June 2, 2014 Share Posted June 2, 2014 Well, you know basically how it works, right? Link to comment Share on other sites More sharing options...
gongpex Posted June 2, 2014 Author Share Posted June 2, 2014 I know basic works on php form to send email, but about the email reply I don't know Q : what I need to build this feature? so please help thanks Link to comment Share on other sites More sharing options...
davej Posted June 2, 2014 Share Posted June 2, 2014 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 More sharing options...
gongpex Posted June 3, 2014 Author Share Posted June 3, 2014 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 More sharing options...
davej Posted June 3, 2014 Share Posted June 3, 2014 Try... <?phpmail('gong@gmail.com', 'My Subject', 'My text message');?> If that doesn't work then you definitely have some other issue. Maybe the email is being filtered by the gmail spam trap? Reference... http://php.net/manual/en/function.mail.php Link to comment Share on other sites More sharing options...
justsomeguy Posted June 3, 2014 Share Posted June 3, 2014 The code itself is fine. Make sure you're testing that on a server that can actually send email. Link to comment Share on other sites More sharing options...
gongpex Posted June 4, 2014 Author Share Posted June 4, 2014 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 More sharing options...
davej Posted June 4, 2014 Share Posted June 4, 2014 Ask your hosting service. Link to comment Share on other sites More sharing options...
thescientist Posted June 4, 2014 Share Posted June 4, 2014 Or you can install a sendmail application locally, I use postfix on my Mac. Link to comment Share on other sites More sharing options...
gongpex Posted June 5, 2014 Author Share Posted June 5, 2014 (edited) 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 June 5, 2014 by gong Link to comment Share on other sites More sharing options...
thescientist Posted June 5, 2014 Share Posted June 5, 2014 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 More sharing options...
gongpex Posted June 6, 2014 Author Share Posted June 6, 2014 Hello, thanks for answer Q : How about free email hosting Can I use it? Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now