Currently I have a contact form on a server which sends a message to the website owner, a simple contact form. I would like the from field to contain the email from the form which the user submits.
mail("email@example.com", "bit of text", $message2, "From: \"$name\" <$email>\$email") or die(" \n There was some error sending the mail please contact me via email directly firstname.lastname@example.org , sorry for the inconvienience.");
this works but the from field must be being overidden from the server as it puts its own server stamp in there.
Am i using mail(); wrong?
I just saw this on php site
If you try to set "From:" e-mail header value under Windows when it is already defined in php.ini "sendmail_from" value, this will doesn't work. If you still want to customize this value, then you must use another option like XPertMailer ( [a href=\"http://www.xpertmailer.com/\" target=\"_blank\"]http://www.xpertmailer.com/[/a] ) to send the e-mail directly to the client SMTP server or use a relay SMTP server with authentification option.