简体   繁体   English

需要帮助以使用PHPMailer发送电子邮件

[英]Need help to send email with PHPMailer

I'm using PHPMailer to send email. 我正在使用PHPMailer发送电子邮件。 Everything is working fine except one thing. 除了一件事,一切都很好。 The email could not be send if the subject contains an UTF-8 character. 如果主题包含UTF-8字符,则无法发送电子邮件。 I've set $mail->CharSet="UTF-8" . 我设置了$mail->CharSet="UTF-8"

Try to encode subject to handle utf8 characters... 尝试编码主题以处理utf8字符...

$sendsubject= "=?utf-8?b?".base64_encode($subject)."?=";
$mail = new PHPMailer();
$mail->Subject = $sendsubject;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM