ASP.NET慢电子邮件发送 [英] ASP.NET Slow email sending

查看:135
本文介绍了ASP.NET慢电子邮件发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的web应用程序(ASP.NET MVC),我用下面发送电子邮件:

In my web app (ASP.NET MVC), I send an email using the following:

        MailMessage msg = new MailMessage("email@domain.com", "somewhere@recipient");
        msg.Body = "Message body";
        msg.IsBodyHtml = false;
        SmtpClient client = new SmtpClient();
        msg.Subject = "Subject";
        client.Send(msg);

我的system.net邮件设置如在web.config中如下:

My system.net Mail Settings are as follows in web.config:

  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="email@domain.com">
        <network host="mail.domain.com" port="25" defaultCredentials="false" userName="email@domain.com" password="mypassword" />
      </smtp>
    </mailSettings>
  </system.net>

这发出的电子邮件罚款。我所遇到的唯一问题是,电子邮件2-3分钟函数调用内发送和接收。

This sends out the email fine. The only issue I've experienced is that the email is sent and received within 2-3 minutes of the function call.

我已经看到了这个在使用SmarterMail,还没等我问在serverfault.com的好乡亲再质疑我的主机两台主机,我想知道如果theres什么编码明智的,可能会导致这2-3分钟的延迟。

I've seen this on two hosts that use SmarterMail, and before I ask the good folks at serverfault.com and then question my host, I wanted to know if theres anything coding-wise that could be causing this 2-3 minute delay.

这似乎是微不足道的,但我作为一个网页浏览者,恨它时我应该得到的电子邮件多久,特别是如果他们有这样的登录信息的关键信息。

It may seem negligible, but I as a web surfer, hate it when emails that I'm supposed to get take long, specially if they have crucial information like login information.

推荐答案

我认为这是关于你的服务器的网络流量。

i think this is about your servers network traffic.

这篇关于ASP.NET慢电子邮件发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆