rondog Posted January 25, 2008 Share Posted January 25, 2008 I cant figure it out...Ive used this similar script many times and when I check my gmail account, I have all these <br/> tags in the message..is it the headers? <?php $name = $_POST['names']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $headers = "From: Racewerks.com<br/>"; $headers .= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $mikesmessage = "Name: $name<br/>"; $mikesmessage .= "Email: $email<br/>"; $mikesmessage .= "Phone: $phone<br/>"; $mikesmessage .= "Message:<br/>$message"; $mike = mail("email@address.com","Message Via Racewerks.com",$mikesmessage,$headers); $user = mail($email,"[Racewerks] Thank you!","$name,<br/>Thank you for contacting Racewerks. We will contact you shortly.<br/><br/><br/>Racewerks Inc.<br/>330 Woodland Drive<br/>Vista, CA 92083<br/>Phone: 760-822-2428<br/>Fax: 760-454-2360<br/>www.racewerks.com<br/>email@address.com",$headers); if($mike && $user) { echo "&msgText=success"; } else { echo "&msgText=error"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87795-solved-not-working-in-mail/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2008 Share Posted January 25, 2008 Each line in the header needs a \r\n on it. Quote Link to comment https://forums.phpfreaks.com/topic/87795-solved-not-working-in-mail/#findComment-449067 Share on other sites More sharing options...
Stooney Posted January 25, 2008 Share Posted January 25, 2008 make sure when you view the email that html is enabled. You're probably viewing it as plain text. Another option would be to use \n instead of 'br' tags on line breaks. Quote Link to comment https://forums.phpfreaks.com/topic/87795-solved-not-working-in-mail/#findComment-449070 Share on other sites More sharing options...
rondog Posted January 25, 2008 Author Share Posted January 25, 2008 ok the \r\n seemed to have worked. Another weird thing happened though. My From line said "RacewerksContent-Type" so I changed that \r\n back to <br/> and it seemed to have fixed it.. thanks Quote Link to comment https://forums.phpfreaks.com/topic/87795-solved-not-working-in-mail/#findComment-449076 Share on other sites More sharing options...
cooldude832 Posted January 25, 2008 Share Posted January 25, 2008 all your headers should be delimetered by \r\n Quote Link to comment https://forums.phpfreaks.com/topic/87795-solved-not-working-in-mail/#findComment-449093 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.