Hello,
I want all of your help here with mail function. I have a feedback form where users will send their feedback about the website but I cant make that page send mail to my accout in yahoo.
Here is the code of feedback.php:
| Code: |
<form name="feedback" METHOD="POST" action="feedback.php">
<td valign="top">
<table width="610" height="249" style="border:0px solid #b4b4b4" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="38%" height="29"><div align="left"><img src="images/feedback.png" width="215" height="22">
</div></td>
<td width="62%"> </td>
</tr>
<tr class="style5">
<td height="24"><span class="style13"> Name </span></td>
<td><input type="text" name="name" value="" maxlength="35" style="border:1px solid #000000"></td>
</tr>
<tr class="style5">
<td height="24"><span class="style13">Telephone</span></td>
<td><input type="text" name="telephone" value="" maxlength="35" style="border:1px solid #000000"></td>
</tr>
<tr class="style5">
<td height="24"><span class="style13">Email</span></td>
<td><input type="text" name="email" value="" maxlength="35" style="border:1px solid #000000"></td>
</tr>
<tr class="style5">
<td height="24"><span class="style13">Comments</span></td>
<td><textarea name="comments" style="border:1px solid #000000"></textarea></td>
</tr>
<tr class="style5">
<td height="17"> </td>
<td> </td>
</tr>
<tr class="style5">
<td align="center" height="35"><input type="submit" value="Submit" name="submit"></td>
<td align="left"><input type="reset" value="Reset" name="reset"></td>
</tr>
<tr class="style5">
<td height="24" colspan="2" align="center"><img src="images/div.png" width="611" height="19"></td>
</tr>
</table> </td>
</form>
|
here is the feedback.php code:
| Code: |
<?php
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= "From: <$EmailAddress2>" . "\r\n";
// Send
$to="tanveer_t2002@yahoo.com";
$subject="subject";
$message="this is body";
mail($to, $subject, $message, $headers);
echo " sent";
?>
|
Am I missing something here ? Do I have to configure anything in mailserver or something?
Thanks in advance.
-Tanveer