ladokha Posted March 22, 2009 Share Posted March 22, 2009 Hey guys i problem in getting form data in email.all code works finE.wHEN I SUBMIT THE BUTTON IT SAYS MESSSAGE SENT SUCCESSFULLY.But when i check my email .I didn't get any emai.so what could be the PROBLEM.My main file is test.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Contact Form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $me = $_SERVER['PHP_SELF']; ?> <form name="form1" method="post" action="<?php echo $me;?>"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td>Name:</td> <td><input type="text" name="Name"></td> </tr> <tr> <td>Subject</td> <td><input type="text" name="Subject"></td> </tr> <tr> <td valign="top">Message:</td> <td><textarea name="MsgBody"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Send"></td> </tr> </table> </form> <?php } else { error_reporting(0); $recipient = '[email protected]'; subject = stripslashes($_POST['Subject']); $from = stripslashes($_POST['Name']); $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']); if (mail($recipient, $subject, $msg)) echo nl2br("<b>Message Sent:</b> To: $recipient Subject: $subject Message: $msg"); else echo "Message failed to send"; } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/150531-help-to-get-form-data-in-email/ Share on other sites More sharing options...
npsari Posted March 22, 2009 Share Posted March 22, 2009 hmmm, I would say that your email provider treated the emails coming from your sever as spam This will propably get better as your server's reputation improves as time goes by Link to comment https://forums.phpfreaks.com/topic/150531-help-to-get-form-data-in-email/#findComment-790667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.