Jump to content

Archived

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

extrovertive

Email send in HTML?

Recommended Posts

This email is just going to be send to one person who has HTML enbabled in their email.

In my $message variable to be used in the mail() function, I have
(ignore the spaces between the tag)
$message = "
< b > Username: </ b > $tutorname
< b > Title: </ b > $tutortitle
< b > First name: </ b > $tutorfirstname
";

Now, when sending it to the email I see < b > Username</ b > not the actually [b]Username [/b]that's bold. How do I make it bold?

Share this post


Link to post
Share on other sites
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

you need them extra headers

Share this post


Link to post
Share on other sites
Thanks.

I tried that but it works in Yahoo mail, outlook, but not Gmail.

In Gmail I get:
[code]
MIME-Version: 1.0

Content-type: text/html; charset=iso-8859-1


[INFORMATION]<br />

<b>Tutor ID: </b> 37 <br />

<b>Username: </b> tester <br />

<b>Title: </b> Mr <br />

<b>First name: </b> Test <br />

<b>Last name: </b> Testing <br />
[/code]

I'm using
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$webmaster = "me@localhost";
@ $mp = mail($webmaster, $subject, $message, "From: $from \r\n" . $headers);
if(!$mp) die("Email error!");

Share this post


Link to post
Share on other sites

×

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.