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 =  "contact@domain.com";


$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.