PHP

HOW TO SEND HTML UTF-8 EMAIL IN PHP

(a quick example)

MAIL TO + MAIL SUBJECT $to = "jon@doe.com"; $subject = "Test";

HTML UTF8 EMAIL (A)

01

MAIL MESSAGE $body = "<html><body> <strong>HTML 強い</strong> </body></html>";

MAIL HEADER $head = implode("\r\n", [   "MIME-Version: 1.0",   "Content-type: text/html; charset=utf-8" ]);

HTML UTF8 EMAIL (B)

02

SEND MAIL mail ($to, $subject, $body, $head);

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