Jump to content

Mail() Function


chibineku
 Share

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...