发送一封电子邮件时,Receiver会收到发件人的多封电子邮件副本

时间:2014-03-13 07:14:09

标签: c# asp.net email

它会在几分钟内发送2-8次。这不会一直发生,也不会在每次向同一收件人发送电子邮件时发生;它似乎是随机的。

我的邮件代码是

SmtpClient oSmtpClient = new SmtpClient();
        oSmtpClient.Port = oSmtpSection.Network.Port;
        oSmtpClient.EnableSsl = bool.Parse(oSmtpSection.Network.EnableSsl.ToString());
        oSmtpClient.UseDefaultCredentials = true;
        oSmtpClient.Host = oSmtpSection.Network.Host;
        oSmtpClient.Credentials = new NetworkCredential(oSmtpSection.Network.UserName, oSmtpSection.Network.Password);

        //Add this line to bypass the certificate validation
        System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object s,
                System.Security.Cryptography.X509Certificates.X509Certificate certificate,
                System.Security.Cryptography.X509Certificates.X509Chain chain,
                System.Net.Security.SslPolicyErrors sslPolicyErrors)
        {
            return true;
        };

请帮忙。

1 个答案:

答案 0 :(得分:0)

此代码没有您要查找的问题。您必须从其他方法调用此方法(一段代码)。该方法被多次调用。您需要在此处调试/记录以了解此调用的次数。