samLar Posted August 12, 2010 Share Posted August 12, 2010 Hy guys, I'm using a simple php mail script but I have a tiny problem there - I might be already so overworked that I can't see it. Basically, the script work as it is but the body copy of the message does not come up as html text - basically it comes up with the code </br> and so on of ther php script. heders and everything else is on the right spot. The code I'm using is here: <?php $mail_formname = isset($_REQUEST['name'])?$_REQUEST['name']:''; // Optional $mail_formemail = isset($_REQUEST['email'])?$_REQUEST['email']:''; // Optional $mail_formnumber = isset($_REQUEST['number'])?$_REQUEST['number']:''; // Optional $mail_formmessage = isset($_REQUEST['message'])?$_REQUEST['message']:''; // Optional $mail_address = "[email protected]"; $headers = "MIME-Version: 1.0\r\n"; $headers = "Content-type: text/html; charset=iso-8859-1\r\n"; $mail_body = "You got a new message from:<br />" . "<br />Name: " . htmlentities($mail_formname) . "<br />Number: " . htmlentities($mail_formnumber) . "<br />Email: " . htmlentities($mail_formemail) . "And his message is the following:<br />" . "<br />Message: " . htmlentities($mail_formmessage) ; $mail_subject = "The subject"; $headers = "To: ". $mail_address ."\r\n"; $headers = "From: ". $mail_formemail ."\r\n"; if(!mail($mail_address, $mail_subject, $mail_body, $headers )){ exit(); } ?> and the image of an email I receive is attached (hope that works). Any help is really appreciated! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/210519-php-mail-form-does-not-work-properly/ Share on other sites More sharing options...
samLar Posted August 13, 2010 Author Share Posted August 13, 2010 Hey guys. No worries - I made a work around and found a much simpler one which does the same job here http://www.w3schools.com/PHP/php_mail.asp Thanks Link to comment https://forums.phpfreaks.com/topic/210519-php-mail-form-does-not-work-properly/#findComment-1098738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.