Solved

System.Net.Mail Performance Problem

Posted on 2006-11-03
4
310 Views
Last Modified: 2012-06-27
Hi - I use the following to send emails from my site. Problem is that the send takes 40 secs but is successful! Anyone have any idea why?
The SMTP service is local on the IIS webserver and suffers from no other performance issues.

Dim MM As New System.Net.Mail.MailMessage(New Net.Mail.MailAddress(FromAddress), New Net.Mail.MailAddress(ToAddress))
MM.Subject = mailsubject
MM.Body = Message
MM.IsBodyHtml = False
Dim smtp As New System.Net.Mail.SmtpClient(System.Configuration.ConfigurationManager.AppSettings("MailServer"))
smtp.Credentials = New System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings("SMTPUser"), System.Configuration.ConfigurationManager.AppSettings("SMTPPswd"))
smtp.Send(MM) 'this line TAKES 40 SECONDS!

THANKS
0
Comment
Question by:ctudorprice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 17868274
does it process for 40 seconds or does the mail take 40 seconds to be received? If it takes 40 seconds to send then I would check your anti-virus and see if it is scanning the smtp mail and if it is blocking port 25. You may also need to check if the router is blocking port 25. If it takes 40 seconds to be received, that isn't anything you can really take care of.
0
 

Author Comment

by:ctudorprice
ID: 17868676
process the "send" for 40 seconds on the webserver - I have tracing and timing.
0
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 17868686
I would try disabling your antivirus for one test. Also you should check and make sure the SMTP Port (port 25) doesn't have any blocks...
0
 

Author Comment

by:ctudorprice
ID: 17870046
Hi - it was actually the mail server's Sender Policy Framework (SPF) check that was causing the massive delay... disabled it and mail works fine.
Thanks for the advice strickdd.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question