有时候电子邮件发送时间不在asp.net

时间:2015-09-08 08:50:15

标签: c# asp.net amazon-web-services windows-server-2008-r2

我正在尝试使用带有godaddy的asp.net代码作为smtp服务器发送电子邮件,但在发送3-4电子邮件服务器后停止发送邮件并给出错误“传输无法连接服务器”。我有一个aws帐户,并尝试发送smtp服务器作为godaddy“。但相同的代码我在我的本地计算机上运行,​​没有问题。

请帮忙! 下面是我的代码:

MailMessage email = new MailMessage();
        email.BodyFormat = MailFormat.Html;
        email.From = "testing@ppms.in";


        email.To = "ashish@techmagnate.com";
        //email.Cc = "tasauwar.ansari@techmagnate.in;";
        email.Subject = "Testing";
        email.Body = "test";
        email.Priority = MailPriority.High;



        // End of attachments processing
        // Set the SMTP server and send the email                  
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtpout.secureserver.net");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", "2");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "testing@ppms.in");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password");
        email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "false");
        SmtpMail.SmtpServer = "smtpout.secureserver.net";

        SmtpMail.Send(email);

0 个答案:

没有答案