Manbhatti Posted February 3, 2007 Share Posted February 3, 2007 I ‘m new to php. I am running XP and installed wamp5 .. I developed a mail form using php mail() function. Some reason it is not firing email . Someone suggested I need a host to this form working, I hosted this file but still this not worked. I tried various setting, none worked. Anyone know exactly what cofig. of SMTP setting I need to make. (I tried various setting still having problem) I will appreciate if some one post me working script which I can test. Regards ManBhatti Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted February 3, 2007 Share Posted February 3, 2007 please show us your code, so we can look at it. Quote Link to comment Share on other sites More sharing options...
Manbhatti Posted February 3, 2007 Author Share Posted February 3, 2007 Following are the codes for HTML form: " <FORM action="5-sendmail.php" method="POST"> <p><strong>Name:</strong><br> <INPUT type="text" size="25" name="name"></p> <p><strong>E-Mail Address:</strong><br> <INPUT type="text" size="25" name="email"></p> <p><strong>Message:</strong><br> <textarea name="message" cols=30 rows=5></textarea></p> <p><INPUT type="submit" value="send"></p> </FORM> " These are codes for php processing file " <?php echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>"; echo "<p>Your e-mail address is: <b>$_POST</b>.</p>"; echo "<p>Your message was:<br>"; echo "$_POST[message] </p>"; //start building the mail string $msg = "Name: $_POST[name]\r\n"; $msg .= "E-Mail: $_POST\r\n"; $msg .= "Message: $_POST[message]\r\n"; //set up the mail $recipient = "manbhatti@hotmail.com"; $subject = "Form Submission Results"; $mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \r\n"; $mailheaders .= "Reply-To: $_POST"; //send the mail mail($recipient, $subject, $msg, $mailheaders); ?> " Look forward to receive your reply! thanks Quote Link to comment Share on other sites More sharing options...
smc Posted February 3, 2007 Share Posted February 3, 2007 Well right off the bat I notice that you need to change your post format from $_POST[name] to $_POST['name'] Quote Link to comment Share on other sites More sharing options...
Manbhatti Posted February 3, 2007 Author Share Posted February 3, 2007 I have used this script with $_POST['name'], but did not work. I think something has to do with connecting ISP mail server, is there any suggestion please? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.