Solved

System.Net.Mail Performance Problem

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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