I am sending an e-mail with PHP to a gmail account.
$message =
"Hi Mario
Today Luigi tried to <b>eat</b> <span style="font-size:8px">Toad</span>.
I am so sorry that formating gmail is not standard. This mail will display the breaks made,
like in heredoc, but not the html. Help me understanding to format E-mails for
Gmail-receivers.
It's a me
Greetings,
Wario";
mail("mario@gmail.com", "Betreff: Luigi nibbled Toad",
$message, "From: itsame@myphpmail.com" );
How could we format that Gmail receivers see preformated text like font-size/weight/etc… ?
Best Answer
You need to set the headers of the message to be formatted in HTML. Add this before your call to
mail()
.Than try sending it with the following: