简体   繁体   English

通过Gmail发送标记为网上诱骗的电子邮件

[英]Sending email through Gmail marked as phishing

I'm sending emails through C# code using Gmail's SMTP server, and on the receiving end Gmail reports: 我正在使用Gmail的SMTP服务器通过C#代码发送电子邮件,并在接收端使用Gmail报告:

This message may not have been sent by: address @gmail.com Learn more Report phishing . 该邮件可能尚未发送者: address @ gmail.com了解详情报告网络钓鱼

The from address I'm using is a gmail.com address. 我使用的是地址是gmail.com地址。

This is the code I'm using: 这是我正在使用的代码:

public class Email
{
    public string FromAddress { get; set; }
    public string ToAddress { get; set; }
    public string Subject { get; set; }
    public string Content { get; set; }
    public string Password { private get; set; }

    public void Send()
    {
        using (var message = new MailMessage(FromAddress, ToAddress) { IsBodyHtml = true, Subject = Subject, Body = Content })
        {
            GetSmptClient(FromAddress, Password).Send(message);
        }
    }

    static SmtpClient GetSmptClient(string userName, string password)
    {
        return new SmtpClient
        {
            Host = "smtp.gmail.com",
            Port = 587,
            EnableSsl = true,
            DeliveryMethod = SmtpDeliveryMethod.Network,
            UseDefaultCredentials = false,
            Credentials = new NetworkCredential(userName, password)
        };
    }
}

Any ideas what I'm doing wrong? 我有什么想法我做错了吗?

您可以在Google应用邮件的帐户设置中设置某种类型的验证码,这可能有所帮助

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

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