sending msg to inbox(contact us)

Posted by Oswaldlily under HTML 5 on 3/19/2014 | Points: 10 | Views : 868 | Status : [Member] | Replies : 1
In every website there is "contact us"

which contains "name/message/mobno/ are mandatory and submit(button) "

how to do this in html?




Responses

Posted by: Oswaldlily on: 3/19/2014 [Member] Starter | Points: 25

Up
0
Down
I m trying like below... but i dint get mail in inbox


<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<a href="mailto:oswald@gmail.com">Send Mail</a>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>ajay</td>
<td>joe</td>
</tr>
</table>


<?php

$to = 'oswald@gmail.com';
$subject = 'Test email';
$message = "Hello World!\n\nThis is my first mail.";
$headers = "From: lily@gmail.com\r\nReply-To: oswald@gmail.com";
$mail_sent = @mail( $to, $subject, $message, $headers );
echo $mail_sent ? "Mail sent" : "Mail failed";
echo '<form action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="submit"/> Your name:<br />
<input name="name" type="text" value="" size="30"/> <br /> Your email:<br />
<input name="email" type="text" value="" size="30"/> <br /> Your message:<br />
<textarea name="message" rows="7" cols="30"> </textarea> <br />
<input type="submit" value="Send email"/>
</form>'
?>

</body>
</html>


Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response