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. Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/ 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"; Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136227 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? Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136230 Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 the header field (the fourth and last) Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136238 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? Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136245 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. Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136248 Share on other sites More sharing options...
the_oliver Posted December 6, 2006 Author Share Posted December 6, 2006 Thanks Link to comment https://forums.phpfreaks.com/topic/29684-sending-email-from-a-form/#findComment-136252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.