PHP

HOW TO SEND HTML UTF-8 EMAIL IN PHP

MAIL TO + MAIL SUBJECT $mailTo = "john@doe.com"; $mailSubject = "Test";

HTML UTF8 EMAIL (A)

01

MAIL MESSAGE $mailBody = "<html><body>"; $mailBody .= "<u>HTML 強い</u>"; $mailBody .= "</body></html>";

MAIL HEADER $mailHead = "MIME-Version: 1.0\r\n"; $mailHead .= "Content-type: text/html; charset=utf-8";

HTML UTF8 EMAIL (B)

02

SEND MAIL mail ($mailTo, $mailSubject, $mailBody, $mailHead);

Yes, we can inline CSS <p style="font-weight:bold">BLAH<>/p>.   But <style> tags will probably not work in many mail clients.

ADDING CSS TO EMAIL

03