Hi all,
I want to know how the submit a form via e-mail. I tried some code but I failed.
this is code that I have tried,
and send_mail.php,Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form_info" method="post" action="send_mail.php"> <div> <table> <tr> <td> Your Email</td> </tr> <tr> <td ><input type="text" name="from" value="email"></td> </tr> <td>Subject</td> </tr> <tr> <td ><input type="text" name="subject" value="subject"></td> </tr> <tr> <td> Message</td> </tr> <tr> <td><textarea name="message"></textarea></td> </tr> <tr> </table> <table > <tr> <td> <input type="submit" name="Email" value="Email"></td> </tr> </table> <input type="hidden" name="to" value="hadunprera@yahoo.com"> </div> </form> </body> </html>
then I was upload this code. http://www.haduntest.comli.com/Code:<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $from = $_POST['from']; $subject = $_POST['subject']; $message = $_POST['message']; $to = $_POST['to']; $to="$to"; $headers.= "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; "; $headers.= "charset=iso-8859-1\r\n"; $headers.= "From: $from"; $subject = "$subject"; $body = "$message"; $send_check=mail($to,$subject,$body,$headers); if ($send_check!=true) {die();} ?> <table align="center" > <tr > <td> <div align="center">YOUR MESSAGE HAVE BEEN SENT </td> </tr> </table> </body> </html>
But it is not working.
When I click one the send button it shows the next page which display "YOUR MESSAGE HAVE BEEN SENT".
But no mail has received to my mail account.
can you tell me what is error with this code ???



Reply With Quote
Bookmarks