chibineku Posted September 9, 2009 Share Posted September 9, 2009 I have a very basic contact form, the action of which is to a script that sanitizes the input and sends me an e-mail. This is the code I have for the mail() function: $headers = 'To: Jonathon <chibineku@aol.com>'. "\n\n";$headers .= 'From: '.stripslashes($tr_email).''."\n\n";$to = "chibineku@aol.com";$subject = "AromaClear E-Mail from: ".stripslashes($tr_email)."";$msg .="Subject: ".stripslashes($tr_subject)."\n\n";$msg .= "Message: ".stripslashes($tr_body)."\n\n";mail($to, $subject, $msg, $headers); When the e-mail is sent, the FROM address is the auto mailer of my server. Is there any way to change that so it says what I want it to say, which is Jonathon <chibineku@aol.com> ? or do I need to change config/ini files for that?An aside: if I want to send HTML mail, I am aware of the headers I need to set, but do I still need to use the appropriate doctype and content-type tags, and is there any point setting a <title> ? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 9, 2009 Share Posted September 9, 2009 Headers need to be separated with \r\n, not \n\n. I don't think an HTML email needs to be a well-formed HTML document, it just lets you use HTML formatting. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.