Jump to content

php mail form does not work properly


samLar

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.