{"id":1905,"date":"2021-09-24T00:43:14","date_gmt":"2021-09-23T16:43:14","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1905"},"modified":"2021-09-24T00:50:09","modified_gmt":"2021-09-23T16:50:09","slug":"%e8%a7%a3%e5%86%b3php%e7%94%a8phpmailer%e5%8f%91%e9%82%ae%e4%bb%b6%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1905","title":{"rendered":"\u89e3\u51b3php\u7528PHPMailer\u53d1\u90ae\u4ef6\u4e2d\u6587\u4e71\u7801\u65b9\u6cd5"},"content":{"rendered":"\n

\u4e3b\u8981\u5c31\u662f\u8981\u8bbe\u7f6e\u4e00\u4e0b\u90ae\u4ef6\u7684\u7f16\u7801\u65b9\u5f0f\u3002\u9ed8\u8ba4\u7684\u662fCHARSET_ISO88591\uff0c\u6539\u4e3aCHARSET_UTF8\u5c31\u53ef\u4ee5\u4e86\u3002\u6309\u8bf4UTF8\u5e94\u8be5\u662f\u56fd\u9645\u901a\u7528\u7684\u4e3b\u6d41\u5427\uff0c\u4f46\u4e0d\u77e5\u9053\u57fa\u4e8e\u4ec0\u4e48\u76ee\u7684\u8fd9\u4e2aPHPMailer\u9ed8\u8ba4\u7684\u4e0d\u662futf8.<\/p>\n\n\n\n

$mail = new PHPMailer(true);\n$mail->CharSet = PHPMailer::CHARSET_UTF8;\n\/\/\u6216\u8005\n\/\/$mail->CharSet = 'utf-8';\n\n<\/pre>\n\n\n\n

\u7248\u672c\u4e3aphpmailer: 6.1.7<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e3b\u8981\u5c31\u662f\u8981\u8bbe\u7f6e\u4e00\u4e0b\u90ae\u4ef6\u7684\u7f16\u7801\u65b9\u5f0f\u3002\u9ed8\u8ba4\u7684\u662fCHARSET_ISO88591\uff0c\u6539\u4e3aCHARSET_UTF8\u5c31\u53ef\u4ee5\u4e86\u3002\u6309\u8bf4UTF8\u5e94\u8be5\u662f\u56fd\u9645\u901a\u7528\u7684\u4e3b\u6d41\u5427\uff0c\u4f46\u4e0d\u77e5\u9053\u57fa\u4e8e\u4ec0\u4e48\u76ee\u7684\u8fd9\u4e2aPHPMailer\u9ed8\u8ba4\u7684\u4e0d\u662futf8. $mail = new PHPMailer(true); $mail->CharSet = PHPMailer::CHARSET_UTF8; \/\/\u6216\u8005 \/\/$mail->CharSet = ‘utf-8’; \u7248\u672c\u4e3aphpmailer: 6.1.7<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[224,9],"tags":[297],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1905"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1905"}],"version-history":[{"count":2,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":1908,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1905\/revisions\/1908"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}