Php email with bold text

hello friends,

i tring to send email using following code:


$to_email = 'somebody@example.com';

$headers =  "To: The Receiver <recipient@some.net>\
" .
    "From: The Sender <sender@some.net>\
" .
    "MIME-Version: 1.0\
" .
    "Content-type: text/html; charset=iso-8859-1";

$subject = 'Subject';

$body = '<html><body><p>Your <i>message</i> here.</p></body></html>';

mail($to_email, $subject, $body, $headers);

but i dont get ant any email .

but code working perfectly

$to_email = ‘somebody@example.com’;

$headers = "From: The Sender <sender@some.net>
";

$subject = ‘Subject’;

$body = ‘Your message here.’;

mail($to_email, $subject, $body, $headers);

Where i m wrong in first code. i want bold text in my email

Have you got an SMTP server set up?

I m not confirm abut smtp. but this yes. because

$to_email = ‘somebody@example.com’;

$headers = "From: The Sender <sender@some.net>
";

$subject = ‘Subject’;

$body = ‘Your message here.’;

mail($to_email, $subject, $body, $headers);

this code working perfectly.
but this not working html or bold.

Try using \r
instead of
.

i have used but no success


$destination 	= 'somebody@example.com';
$subject 		= "Subject";

$headers  		= 'MIME-Version: 1.0' . "\\r\
";
$headers 		.= 'Content-type: text/html; charset=iso-8859-1' . "\\r\
";
$headers 		.= 'To: The Receiver <recipient@some.net>' . "\\r\
";
$headers 		.= "From: The Sender <sender@some.net>" . "\\r\
";

$message		= "<html><body><p>Your <i>message</i> here.</p></body></html>";

if(mail($destination, $subject, $message, $headers))
{
echo "Email Sent: " . $message;
}
else
{
echo "Server messed up.";
}

Try this. It works on my setup.

Also, has it occurred to you that you have no bold tags in your html?

return me echo “Server messed up.”

Then the function is failing. Try removing the “To:” header.

The PHP mail function will only work if the server is setup properly as far as I understand it. If you continue to have issues you may have luck asking in the appropriate server forum.

http://www.php.net/manual/en/function.mail.php for more information

i have temove to but same return.