Hello there,
Actually i’m facing a problem regarding a contact form. I just want to receive the data send from my webviewers through mail. I have created a form and i want to send that data through mail but unfortunately it is showing mail is sent successfully but i’m not getting any mail. i have check my spam folder and did not find any mail there.
Here is my code-
<div class="hire">
<font > <center>Contact Us</center></font><div class="line"></div>
<form action="" method="POST">
<table cellpadding="10">
<tr><td>Name :</td>
<td><input type="text" name="name" class="hirebtn" placeholder="Name"></input></td></tr>
<tr>
<td>Mail :</td>
<td><input type="text" name="mail" class="hirebtn" placeholder="Mail"></input></td>
</tr>
<tr>
<td>Contact No : </td>
<td><input type="text" name="phn" class="hirebtn" placeholder="Contact No"></input></td>
</tr>
<tr>
<td>Describe :</td>
<td><textarea name="des" class="hirebtn" placeholder="Describe your Project"></textarea></td>
</tr>
<tr><td><input type="submit" name=submit class="btnn btnn2" value="submit"></input></td></tr>
</table>
</form>
<?php
$your_email = "mymail@mail.com"; // email address to which the form data will be sent
$subject = "lex"; // subject of the email that is sent
if (isset($_POST["submit"])) {
$nam = $_POST["name"];
$pho = $_POST["phn"];
$ema = trim($_POST["mail"]);
$com = $_POST["des"];
if (get_magic_quotes_gpc()) {
$nam = stripslashes($nam);
$ema = stripslashes($ema);
$pho = stripslashes($pho);
$com = stripslashes($com);
}
$email_body =
"Name: $nam\
\
" .
"Email: $ema\
\
" .
"Telephone: $pho\
\
" .
"MESSAGE:\
\
" .
"$com" ;
// Assuming there's no error, send the email and redirect to Thank You page
if (isset($_REQUEST['des'])) {
mail ($your_email, $subject, $email_body, "From: $nam <$ema>" . "\\r\
" . "Reply-To: $nam <$ema>");
echo "Mail sent";
}
else{
echo "Not sent";
}
}
?>
please check above code and if find solution
Thanks .