在我的web应用程序(ASP.NET MVC),我用下面发送电子邮件:
In my web app (ASP.NET MVC), I send an email using the following:
MailMessage msg = new MailMessage("email@domain", "somewhere@recipient"); msg.Body = "Message body"; msg.IsBodyHtml = false; SmtpClient client = new SmtpClient(); msg.Subject = "Subject"; client.Send(msg);我的system邮件设置如在web.config中如下:
My system Mail Settings are as follows in web.config:
<system> <mailSettings> <smtp deliveryMethod="Network" from="email@domain"> <network host="mail.domain" port="25" defaultCredentials="false" userName="email@domain" password="mypassword" /> </smtp> </mailSettings> </system>这发出的电子邮件罚款。我所遇到的唯一问题是,电子邮件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的好乡亲再质疑我的主机两台主机,我想知道如果theres什么编码明智的,可能会导致这2-3分钟的延迟。
I've seen this on two hosts that use SmarterMail, and before I ask the good folks at serverfault 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慢电子邮件发送
发布评论