Hi ppl,

I have a mail function as follows:

mail($mail_to,$mail_sub,$mail_mesg,$headers);

Now, for $mail_mesg i want the message to be in html format as follows:

$mail_mesg="You have received a message from ur boss... 
<a href=Login.php>Click here to view it.... </a>"

But this is not working... the code b/w <a> </a> is not being recognised as HTML and my mail is as follow:

You have received a message from ur boss... 
<a href=Login.php>Click here to view it.... </a>"

Hw do i work this out...

Thanx in advance

Recommended Answers

All 2 Replies

you will need to send a header declairing the html something like..

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";

hope it helps...

Php has no problem with HTML tags the problem lies in the header the email is sending out - it is not telling the mail program that the email contains HTML.

emhmk1's solution should give you what you are looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.