the_oliver Posted December 6, 2006 Share Posted December 6, 2006 Hello.I have a from, which when submited sends the infomation as an email. to do this i use this code[code]$success = mail($EmailTo, $Subject, $Body, "From: <$From>");[/code]However i want to be able to include HTLM code in the $Body part. At the moment im doing it by starting the body with:[code]$Body = " <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>......[/code]However the emails always show the actual code, no the effects!What am i doing wrong?Thanks. Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 $mail_header = "MIME-Version: 1.0" . "\r\n";$mail_header .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; Quote Link to comment Share on other sites More sharing options...
the_oliver Posted December 6, 2006 Author Share Posted December 6, 2006 Thanks, But were do i put that? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 the header field (the fourth and last) Quote Link to comment Share on other sites More sharing options...
the_oliver Posted December 6, 2006 Author Share Posted December 6, 2006 Still dont get it. Header field in what? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 In the mail() function. $success = mail($EmailTo, $Subject, $Body, "From: <$From>");The one you have from in at the moment, just change that to $header which you can just define with the from: and content and stuff before hand. Quote Link to comment Share on other sites More sharing options...
the_oliver Posted December 6, 2006 Author Share Posted December 6, 2006 Thanks 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.