smtp mail very slow to send

Discussion in 'ASP.NET / ASP.NET Core' started by MrMark, Mar 20, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I send an smtp email from my web site to a dozen or so people who subscribe to my site. I send each mail individually and each message takes about 6 seconds to send.

    Here is the code at the heart of the issue (ASP.Net 3.5 c#)


    Email email = new Email(from, to, subject, body);
    email.IsHtml = false;
    email.Server = server;
    Log.WriteLog("Send Started");
    email.Send();
    Log.WriteLog("Send Ended");


    The time between the two log writes is 6 seconds, should it be that slow.
    I am using DASP smtp server.

    Thanks for reading
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    What is the SMTP server set to?
     
  3. Hi Bruce,

    localhost is the server, should it be different?
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Localhost should not take that long to accept a single message. How big is the message?
     
  5. just a few words i have a test harness that i just ran, this time on smtp.quotationmark.co.uk as the server and run 1 was 11 seconds run 2 6 seconds. Very strange, web config extract below...

    <system.net>
    <mailSettings>
    <smtp from="[email protected]">
    <network host="smtp.quotationmark.co.uk" password="blah" userName="[email protected]"/>
    </smtp>
    </mailSettings>
    </system.net>
     
  6. Hi Bruce,

    I have fixed it, I was not using localhost in my config correctly. Thanks for nudging me in the right direction :)

    Mark
     
  7. mjp

    mjp

    Glad you got it worked out.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page