Solved

System.Net.Mail Performance Problem

Posted on 2006-11-03
4
298 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
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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