dare87 Posted March 7, 2008 Share Posted March 7, 2008 I am trying to send a message using php, but my server keeps overriding the header. I try and it is changed $headers = "From: noreply@blah.com \r\n"; but if I try I get Parse error: syntax error, unexpected T_STRING $headers = "From: "test" <noreply@blah.com> \r\n"; am I missing something? Thanks Quote Link to comment Share on other sites More sharing options...
SkullzY88 Posted March 7, 2008 Share Posted March 7, 2008 this shuld help you out take a look at this code and then either use instead of your own or use it to help fix your own wot ever you decide <?PHP $to = "YOUR EMAIL ADDRESS HERE"; $subject = $_POST["title"]; $name = $_POST["name"] $message = $_POST["message"]; $messagesent = "From: $name Message: $message"; $from = $_POST["email"]; $headers = "From: $from"; mail($to,$subject,$messagesent,$headers); echo "Your message has been sent, thank you."; ?> Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted March 7, 2008 Share Posted March 7, 2008 be known that different mail servers use different headers for sending mail and dont rely only on one type of header patterns,ex the header that worked for yahoomail may not work for hotmail and so on. Quote Link to comment Share on other sites More sharing options...
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.