有趣的字符在纯文本电子邮件发送时使用PHPMailer


Funny Characters in Plain Text email when sending using PHPMailer

我有一个奇怪的问题。我从文本文件中读取文本,使用str_replace将所有值替换为相关值,然后通过PHPMailer以纯文本形式发送电子邮件给收件人。

现在我的问题是,每当收件人收到我的邮件时,他都会看到像'0D'这样的字符

1. DOMAIN NAME and ACTION=0D
=0D
    Give the name of the subdomain.  This is the name that will be=0D
    used in tables and lists associating the domain with the name=0D
    server and IP addresses.  The .co.za domain names that are=0D
    delegated by UniForum S.A. are at the third level, for example:=0D
    thisnetwork.co.za.  Domain names in the CO.ZA zone are limited=0D
    to 30 characters.=0D
    The Action field specifies whether this is a 'N'ew application, an=0D
    'U'pdate or a 'D'eletion.=0D

这是我的PHPMailer代码我尝试在其中设置编码但这也不起作用

$mailer->CharSet = 'UTF-8';

这看起来像"quote -printable" content-transfer-encoding

您可以按如下方式设置传输编码:

$mailer->Encoding = "8bit";

PHPMailer手册中应该有一个支持的编码列表