Send formated (bold, html, ...) Email to Gmail with PHP -


i sending e-mail php gmail account.

$message =  "hi mario  today luigi tried <b>eat</b> <span style="font-size:8px">toad</span>.  sorry formating gmail not standard. mail display breaks made, in heredoc, not html. me understanding format e-mails  gmail-receivers.  it's me greetings,  wario";  mail("mario@gmail.com", "betreff: luigi nibbled toad", $message, "from: itsame@myphpmail.com" ); 

how format gmail receivers see preformated text font-size/weight/etc... ?

you need set headers of message formatted in html. add before call mail().

$headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'from: itsame <itsame@myphpmail.com>' . "\r\n"; 

than try sending following:

mail("mario@gmail.com","betreff: luigi nibbled toad", $message, $headers); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -