Jump to content


Photo

Email send in HTML?


  • Please log in to reply
2 replies to this topic

#1 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 15 August 2006 - 08:23 PM

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 Username that's bold. How do I make it bold?

#2 Exussum

Exussum
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 15 August 2006 - 08:33 PM

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

you need them extra headers

#3 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 16 August 2006 - 03:15 AM

Thanks.

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

In Gmail I get:
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 />

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!");




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users