Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I send an smtp email from my web site . I send each mail individually and each message takes about 6 seconds to send. It's too slow please give me solution to
improve performace or alternative to sending mail fast.
Posted
Updated 3-Oct-22 3:01am

It depends on network speed + sending server load + receiving server load.

For fast results please use SendAsync() method of System.Net.Mail.SmtpClient. It sends mails within less than a second.

Please follow this link-
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx[^]

please mark as answer if helped.
 
Share this answer
 
v4
Hi Nilesh,

You can use multitasking threading concept to sent email to improve performance.

Refer the below link for same.

http://stackoverflow.com/questions/10731747/send-bulk-email-using-c-sharp-multithreading-concept[^]

http://www.emailarchitect.net/easendmail/kb/csharp.aspx?cat=13[^]
 
Share this answer
 
The very first thing you need to check is that whether you are able to connect to the mail server quickly.

telnet to port 25(port which you are trying to send mail) of the mail server. If it takes too much time then contact your administrator for further help.

There are many factors which may make the mail sending bit slower like Anti-virus program checking or network speed.
 
Share this answer
 
I had the same issue, though each email was taking up to 20 seconds :/ After chatting back and forth with the hosting provider (same one for the cloud web server and mail server) I still had no luck.

I researched between yesterday and today and finally came across a note in the documentation on SendGrid.com that mentioned that some hosting providers limit/throttle SMTP port 25.

I changed to the other SMTP port 587 and it went down from 20 seconds to less than a second per email.
 
Share this answer
 
Comments
ashu2001 15-Jan-19 0:53am    
Hi although this is a quite old post but i am struck with the same problem as well changed the PORT from 25 to 50 but no luck. In my case my mail takes ages to shoot and it slows down the post back event as well which in turns ruins the performance as well. I tried to use threading concept as well but no luck in that case as well. In my case while debugging every thing goes fine and mail is sent within a second. Can any help to find out the exact problem
I had the same issue. Even with async call it would take 5-15sec to just make a send call. Contacted my hosting company customer service. They asked me to use ip address instead of a host name and that worked like a charm.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900