locked
send mail from web page too slow RRS feed

  • Question

  • User1681391803 posted

    I have a web page that at the click of a button must send a bunch (1000+) emails.  Each email is sent individually.  I have the code working fine, using Mail Message classes and smtp and all that.  But sometimes even when I'm just sending one e-mail the web page takes a minutes or so to post.  When there is 1000+ the page can sit there for 10 minutes or more... Can anyone tell me why it is so slow, or how to fix the problem?  I can't use CC or BCC.... too many mails, plus I don't want spam catchers to put my mails in the trash...

    To address this I am thinking of just creating a queue table to write the emails to, then using a .net console app running via sql agent scheduled job to periodically send the emails in batch mode.  However, I worry that this may also be slow?

    Does anyone have a better architecture for this solution?  If so give me some ideas.  Thanks! 

    Wednesday, December 27, 2006 11:27 PM

All replies

  • User-158764254 posted

    if you are using an external smtp server then that is most likely the cause of the sluggishness.

    on my server, i setup the local smtp service.  Then i configured its smarthost setting to deliver all mail it received to our real smtp server.
    Our real smtp server is configured to accept relays from the server i'm sending from.
    from my webpages, i now always send email to the local smtp server (127.0.0.1).  These messages are now sent from the page very quick.

    the local smtp service queues all messages and processes them (relays them) in the background to the real smtp server (the smarthost) for delivery.

    Wednesday, December 27, 2006 11:52 PM
  • User259438541 posted

    Hi mbanavige,

    Although this is a very old post. But this issue is becoming a headache to me i am not able to figure out where the exact problem is my application takes too long to send mail at an click event which keeps the page in post back state (page keeps loading) sometime mail is not sent and a message is displayed that unable to connect to exchange server.

    Just to mention that we have our own mail sever installed in house and web application is hosted in house as well. But both server are separate.

    Please help our administrator says its fault in my code.

    Monday, December 31, 2018 7:26 AM