通过gmail api发送电子邮件时,在邮件主题中使用撇号产生问题



当发送邮件时使用以下subject,apostrophe替换为其他字符

Actual主题:我们将为您打100,800个陌生电话

Mail Shows主题:我们将为您打100,800个推销电话

当我通过api发送电子邮件时发生问题,当从SMTP发送电子邮件时它工作正常

请查看下面的api代码

string msg = "From: " + FromName + "<" + From + ">" + " rn" +
"To: " + ToName + "<" + To + ">" + " rn" +
"BCC: " + BCCEmail + " rn" +
"Subject: " + Subject + " rn" +
"Message-ID: mID_" + messageID + "rn" +
"References: "+encryptMessageID + "rn" +
"In-Reply-To: " + encryptMessageID + "rn" +
"Content-Type: " + contentType + "; charset=us-asciirnrn" + Body;
dynamic objSendMsg = new { raw = commonFunction.Base64UrlEncode(msg) };
if (!string.IsNullOrEmpty(messageThreadID))
objSendMsg = new { raw = commonFunction.Base64UrlEncode(msg), threadId = messageThreadID };
var _objSendMsg = JsonConvert.SerializeObject(objSendMsg);
var strSendMsg = new StringContent(_objSendMsg, UnicodeEncoding.UTF8, "application/json");

当相同的内容时,我在body中应用撇号

请查看附件截图

电子邮件副本

您需要对主题标头进行base64_encode以纯文本形式发送。

Subject: " +  Convert.ToBase64String(Subject) + " rn" +

相关内容

  • 没有找到相关文章

最新更新