Mailkit将垃圾数据添加到HTML电子邮件中

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (1)
  • 关注 (0)
  • 查看 (8)

当我使用MailKit在C#程序中发送电子邮件(带有HTML)时,以下文本被附加到电子邮件中。到目前为止,这只发生过一次,但我需要尽快解决这个问题,我不知道原因是什么。

。+ OK 4846个八位字节返回路径:收到:来自删除的删除,LMTP id为oCz8LJ / vJV1c / gAAu9w7lQ(信封来自); 星期三,10 Jul 2019 11:01:03 -0300返回路径:信封到:删除交货日期:星期三,2017年7月10日11:01:03 -0300收到:来自mail-qk1-f176.google.com( [209.85.222.176]:41045)通过删除esmtps(TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)(Exim 4.92)(信封来自)id 1hlD9W-000Gyy-HM for sistemas@alpha2000.com ; 于2019年7月10日星期三11:01:03 -0300收到:mail-qk1-f176.google.com,SMTP标识为v22so1924865qkj.8; 2019年7月10日星期三07:00:38 -0700(PDT)DKIM-Signature:v = 1; A = RSA-SHA256; C =轻松/放松; d = gmail.com; S = 20161025; h = message-id:date:mime-version:from:to:subject:content-transfer-encoding; BH = brObbSje35N7xVFbs7xQUyaaQ4xVQmOUwn98DaoeEnk =; B = cnwCd46odf63vnU4HcqwMQgezOgcBnwL73XtadMXNG8El0kcsFlzPh8ACo22v23dxD TnlMUq7o1MV / BcYbUpWh5RgDZyVaS / hCQZ / RCPzOvoULZ4lcAvZ9lgpnYfh1im + W + PJC DV + TyTwSil6U0bNu1jLNWmHpZUOQe + KS05 / TVt0XmdyGpbQUP80QJfQaADQPOWxwTs5R XihyZkGzsmlCmb4 / KVpBKIbJsKayoHr6bVSosa0ZyfxeKz5YXUClXbgFEmaeDwB9XmPo D1aJnV8Hta5LYt1 + qom2YN8J45pHwB / DC4 + Y0YNmSwH0YHV1TcD9vEtTjHqeJyaQTJCS 6THg == X-谷歌-DKIM签名:V = 1; A = RSA-SHA256; C =轻松/放松; d = 1e100.net; S = 20161025; h = x-gm-message-state:message-id:date:mime-version:from:to:subject:content-transfer-encoding; BH = brObbSje35N7xVFbs7xQUyaaQ4xVQmOUwn98DaoeEnk =; B = KkDQIkc688QT7jbkJLm1KF5qzreiTIrGNt8iXJ0hn8n7NzbNv3vxIXI / bEFHsuFdZ9 RpCrMl1cTH77eWi / VeLyN0PlkIwmOHrDYpcLp6Gfn4fN7KGWmnQ3K7MtrE + ZkjB3eOwy Mb8a1 + J / M / EkO1t / Uv56X3jGBbvldQ667pFnWDogJa4CVepDhVcbt1zmiEAsSVa5VBSg CeUJRG1fvNqXVU6juav6Ma / XE / 93XYDslUzw + sGG7KwKNeMCbmNo + Vjjs5KlsROMUk7r BpAyLXr5ZLF84kaaU8kA5mtTTUvfcCGBKEusOg44FkMrax0gB2F1ldnCR7fGqHNnib4I gv8g == X-GM-消息州:APjAAAVq3Xd90dlf11F6BemubaLr3s9iQWfey6GHVr5dKOZqguxX9Rp2 knYMCxA0kSETdrINF4RBixBDngnf X-谷歌-SMTP-来源: APXvYqzZOgYRWFctT11UUkmeskaxTEeiaaRWwmOIc5znfZbEUbphIvWOgvPVJ7In3ow4SDr8qbV + nQ == X-Received:by 2002:ae9:de05 :: with SMTP id s5mr21772108qkf.184.1562767205852; 2019年7月10日星期三07:00:05 -0700(PDT)收到:来自smtp.gmail.com的删除,ESMTPSA id s11sm1062274qkm.51.2019.07.10.07.00。04 for(version = TLS1 cipher = ECDHE-RSA-AES128-SHA bits = 128/128); Wed,10 Jul 2019 07:00:05 -0700(PDT)Message-ID:Date:Wed,10 Jul 2019 07:00:05 -0700(PDT)X-Google-Original-Date:10 Jul 2019 07:00 :03 -0700 MIME-Version:1.0 From:删除至:删除主题:Resumen内容类型:text / html; charset = us-ascii Content-Transfer-Encoding:quoted-printable X-Spam-Status:No,score = 1.1 X-Spam-Score:11 X-Spam-Bar:+ X-Ham-Report:垃圾邮件检测软件,正在运行在“已删除”系统上,尚未将此传入的电子邮件识别为垃圾邮件。原始邮件已附加到此,因此您可以查看它或标记类似的未来电子邮件。如果您有任何疑问,请参阅root @ localhost了解详细信息。内容预览:ok - REDACTED.pdf ok - REDACTED.pdf内容分析详情:(1.1分,5。

编辑:这是创建电子邮件的代码:

var mimeMessage = new MimeMessage();
        mimeMessage.From.Add(new MailboxAddress(emailSettings.SmtpConfig.FromName, emailSettings.SmtpConfig.From));
        mimeMessage.To.AddRange(direcciones.Select(d => new MailboxAddress(d)));
        mimeMessage.Bcc.Add(new MailboxAddress(emailSettings.SmtpConfig.From));
        mimeMessage.Subject = titulo;
        var bodyBuilder = new BodyBuilder
        {
            HtmlBody = html
        };
        mimeMessage.Body = bodyBuilder.ToMessageBody();
        using (var client = new SmtpClient())
        {
            await client.ConnectAsync(emailSettings.SmtpConfig.Host, emailSettings.SmtpConfig.Port, emailSettings.SmtpConfig.UseSsl);
            await client.AuthenticateAsync(emailSettings.SmtpConfig.UserName, emailSettings.SmtpConfig.Password);
            await client.SendAsync(mimeMessage);
            await client.DisconnectAsync(true);
        }

我使用Outlook 2013查看了该电子邮件。

提问于
用户回答回答于

如果您查看邮件标题,很明显您的垃圾邮件检测软件会修改邮件(因为标题会这样说)。这与MailKit无关。

扫码关注云+社区

领取腾讯云代金券