artstarved Posted March 9, 2009 Share Posted March 9, 2009 I am trying to format this code so that it does not dump all of the text from different inputs into one garbled mess in the e-mail message. To do this I am trying to use html to add a header and line break so that the emails is formatted but it is just spitting my html out like it is plain text when I open the e-mail. Tags and all. If anyone can help that would be great, I am pretty new to PHP. Here is my PHP: <?php //Organization Name $mail_from="$organization"; //Organization Telephone $message.="$organization_phone"; //Organization Mail $message.="$organization_mail"; //General Inquiries $message.="$general_inquires"; // From $header="from: $organization <$mail_from>"; // Enter your email address $to ='dealers@countrydelights.ca'; // Variables $message.=$var1.'<p>organization phone number</p><br>'.$var2.'<p>organization email</p><br>'.$var3.'<p>general inquiries</p><br>'; // Send Form $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> Quote Link to comment Share on other sites More sharing options...
mrdamien Posted March 9, 2009 Share Posted March 9, 2009 <?php //Organization Name $mail_from="$organization"; //Organization Telephone $message.="$organization_phone"; //Organization Mail $message.="$organization_mail"; //General Inquiries $message.="$general_inquires"; // From $header="From: $organization <$mail_from>\n". "Content-type: text/html"; // Enter your email address $to ='dealers@countrydelights.ca'; // Variables $message.=$var1.'<p>organization phone number</p><br>'.$var2.'<p>organization email</p><br>'.$var3.'<p>general inquiries</p><br>'; // Send Form $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> You gotta specify Content-type in the headers. 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.