Guest xaav Posted November 30, 2011 Posted November 30, 2011 For future reference, does php mail() only work on Linux servers? Or is it just the way that this host has set up their Windows server? PHP mail works on any platform, if you have it configured correctly. The problem (sadly) is not windows; the problem is that they have not configured the server correctly. Quote
jalpro Posted December 3, 2011 Author Posted December 3, 2011 Is there a proper way to write the From and Reply-to headers for an email?The email from my form is coming through as "postmaster@domain.com" rather than the email I used in the headers. This is the code I was using before: $headers = "From: $email\r\n"; $headers .= "Reply-to: $email"; Then I Googled it and saw a post that said it had to be in the ' "Name" <email> ' format.I changed my code to the following, ignoring Reply-to for the time being: $headers = "From: \"".$contactname."\" <".$contactemail.">\n"; But that code didn't work either. Any ideas?Thanks Quote
Byron Posted December 3, 2011 Posted December 3, 2011 Like this and it's a good idea to send a content type header: $headers = "From: $name <$email>\n"; $headers .= "Reply-to: $name2 <$email2>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; Quote
jalpro Posted December 3, 2011 Author Posted December 3, 2011 I put in those headers.But for some reason, the email doesn't sent with headers.It works fine if it's just: mail($to, $subject, $body); Quote
Byron Posted December 3, 2011 Posted December 3, 2011 I can't say what your problem is, but this email form works fine on our servers: http://byrondallas.heliohost.org/helio/email_form.php Text version:http://byrondallas.heliohost.org/helio/email_form.txt Quote
Krydos Posted December 3, 2011 Posted December 3, 2011 Then I Googled it and saw a post that said it had to be in the ' "Name" <email> ' format.I haven't actually looked this up to verify it, but I seem to remember something about crappy windows servers requiring "Name" <email@address.com> type format. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.