ASP.NET Email Queue

Posted on 2010-01-08
Last Modified: 2013-11-15

I need to send out quite a few different emails every day from an web application.

Does anyone have any ideas how I can queue up these emails so I dont get blacklisted?

Question by:philip_doherty
    LVL 12

    Expert Comment

    If your problem lies in getting blacklisted if you are sending lot of emails in say few minutes straight, then MSMQ can solve your problem. Go thru this article:

    It basically uses messaging queue for the same and once you program it correctly, your web application will not need to wait for the mail to be delivered, instead it just submits to the queue (which takes very less time than email code in c#)  and then can continue with its work.

    The article sends newsletters but you can just put in anything that you want.


    Author Comment


    How often does this send out an email, I dont see any timing code. Also can I use this from a shared hosting provider as I dont have access to the machine smtp client only my 3rd party email?

    LVL 18

    Accepted Solution

    I follows some approaches while sending bulk emails and don't get blacklisted.:

    1) There must be some time gap (time stamp) between email sent. Supposing if you are sending emails in a loop, then gmail (or any other recipient server) will get hundreds of emails in one second.
    In shot the time stamp of those emails will be same and gmail will think that its an mail bombing.
    So in your loop place code to pause (use thread.sleep) the processing for a few milliseconds after sending emails to say 10 users. This helps a lot in yahoo and gmail

    2) Emails must be sent from multiple email ids.
    Try to send emails from 2-3 different emails accounts, it will not bombard your from email account and if u see all the mass mailing emails comes from different email addresses because the old email be blocked.

    3) Always include unsubscribe link in emails.
    This will help users to remove their email from your records, if they wont find unsubscribe option then they will mark your email as SPAM and in long term (depending upon some calculations) if gmail founds that your emails are getting spam tagged by most of the recepients, your next emails will also be placed into the sapm.

    4) always filter the sender email account's mailbox, and check for the failed emails, then remove them from your database.
    This will help you in removing the bad/dead emails from your database.
    All mail servers keeps track of that for how many times u tried to send email on a bad email.

    5) Yahoo doamin keys
    This is useful while sending emails to yahoo emails.

    6) Reduce the number of retry.
    When the recipient server rejects/deny the emails, the sender's mail server retries to deliver the message several times. This setting is mentioned in the mail sever settings. Reduce this number of retries to 2, hence if your server is trying to send email to a bad email id then  the recipient server will not be bombared by emails.

    I hope that i explained  my points clearly.
    LVL 12

    Expert Comment

    Using MSMQ you can time it say start sending it every 5 minutes or so. It will basically call your code and it is upto the code what to do next.

    No, if you do not have access to the server , you can't setup MSMQ. You atleast need a virtual private server or sort of where you can setup MSMQ. Once it is setup, its a breeze to send out emails.
    But if you are using 3rd party hosting that doesn't provide this , you need to look for another alternative.

    Author Closing Comment

    its a b cos it was 'good' not 'excellent'.

    why does everything need to be an 'A'!!!!!!!!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Title # Comments Views Activity
    HTML table 7 36
    Export Dataset to Excel xlsx 8 56
    move items from one listbox to another 2 21
    Dentrix G4 1 11
    Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
    Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
    This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
    The viewer will learn how to back up with the free utility from runtime software, DriveImageXML using Windows 8. Download DriveImageXML from Open folder where it was saved: Start installation by double clicking the install scrip…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now