Question : How do I send mail using PHP mail()

Hey I am trying to send a piece of email automatically whenever someone submits a form. When I click on the 'submit' button from the previous page it should take me to this page with this code on it. It doesn't seem to go there and then it says that the connection has been dropped and this happens when the server gets busy. Can anyone help me figure this out.

Also, I am not testing on my localhost server, but on my real IXwebhost server.

Thanks
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:


  High School Dating Guide


  

Here is the link below to check out the free high school dating guide

High School Dating Guide

'; // 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 .= 'To: Mary ' . "\r\n"; $headers .= 'From: High-School-Date ' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?>

Answer : How do I send mail using PHP mail()

I suggest using a PHP class for that like because your headers and to and a lot of other things are completly messed up in your code.
http://phpmailer.sf.net
http://swiftmailer.sf.net
Random Solutions  
 
programming4us programming4us