PHP: Sending Html/plain Email by mb_send_mail 发送HTML/Plain格式的邮件

Categories: PHP; Tagged with: ; @ August 28th, 2010 14:55

使用mb_send_mail方法发送html/plain格式的Email, HTML格式的邮件.

本方法将根据trim后的邮件内容设置email类型: 如果以"<"开始, 则将邮件设置为Html格式, 反之为plain格式.

(more…)

PHP Mail()发送邮件乱码解决方案

Categories: PHP; Tagged with: ; @ July 16th, 2010 22:30

网上有很多Mail()乱码的解决方案, 但试了几个都不. 彻底的解决方法是重写php.ini中的代码设置: 将以下代码加到mail()前:

/**
 * Solve the email problem.
 */
ini_set("mbstring.language", "Neutral");
ini_set("mbstring.internal_encoding", "UTF-8");
ini_set("mbstring.http_input", "UTF-8");
ini_set("mbstring.http_output", "UTF-8");
ini_set("mbstring.encoding_translation", "On");
ini_set("mbstring.detect_order", "auto");
ini_set("mbstring.substitute_character", "long");



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.