Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to send 1000 E-mails within few seconds

(0) ShareShare
ReportReport
Posted on by 23,116

I have a requirement of sending more than 1000 E-mails at one time. These emails are send to clients in the NAV database and all of these emails should be sent separately to them with a attachment of a PDF and more importantly these should be sent at one time ( as a example every day 9.00 am, depending on a set criteria)

Each of these emails are created using a template and certain fields are only changed depending on the client name, due balance, and due date. 

What is the best way of doing this? 

I have done this using NAV code units and it works fine. Only problem is it take around 10-15 min to do this work and during that time NAV get freeze and cannot do any work. As a solution I have written a DLL to handle this and still the same problem there and I only manage to reduce the time to 10 min. 

 

Any idea is highly appreciated

 

*This post is locked for comments

  • Suggested answer
    Saurabh Shah Profile Picture
    4,560 on at
    RE: How to send 1000 E-mails within few seconds

    Hi Tharanga,

    Please follow below thread of community for segment information.

    community.dynamics.com/.../145905.aspx

    -Saurabh Shah

  • keoma Profile Picture
    32,727 on at
    RE: How to send 1000 E-mails within few seconds

    hi tharanga,

    maybe also interesting for you.

    cue: "segment functionality of CRM module in Dynamics NAV"

    follow community.dynamics.com/.../145905.aspx

  • Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: How to send 1000 E-mails within few seconds

    [quote][/quote]

    In NAV 2013  you can create background sessions.  Split the work against the 20 background session and as long as they don't lock each other out, you'll be able to process them in parallel.  By increasing the background sessions you can the sweet spot for acceptable background sessions.

    Thank you for the idea. 

    I have developed a DLL which will handle the E-Mail sending section. PDF files were created using a background job in NAV and it was done prior to start the E-Mail sending process and save the files in a shared folder. After that DLL methods were called from a use of another background job. 

    So everything is working behind the back and NAV works perfectly without any freeze. Plus it take only 6 min to send the emails. 

    Thank you everyone for all the support and ideas given. 

    Even though I have completed this, I still value if you have any more ideas. Who knows best idea would be that.  :) 

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: How to send 1000 E-mails within few seconds

    follow

    www.codeproject.com/.../Ready-to-use-Mass-Emailing-Functionality-with-C-NE

  • Suggested answer
    epernst Profile Picture
    1,122 on at
    RE: How to send 1000 E-mails within few seconds

    Hi,

    Sounds like a bit of a challange! :)

    When I'm sending out my newsletter from DUG, then I'm using an ASP.NET based newsletter application. This application again is using something called Easymail SMTP Express (www.quiksoft.com/smtpexpress). This way it's sending up to 256 mails simultaneous.

    You need to integrated this into your DLL.

  • Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: How to send 1000 E-mails within few seconds

    Thank you for the suggestion, but using a addon is not an option. :)

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: How to send 1000 E-mails within few seconds

    you can also use ready to use addons.

    www.simplydynamics.ie/.../sd-bulk-mailer

    www.expandit.com/.../ExpandIT+MailIT

  • Verified answer
    Rashed Profile Picture
    3,765 on at
    RE: How to send 1000 E-mails within few seconds

    In NAV 2013  you can create background sessions.  Split the work against the 20 background session and as long as they don't lock each other out, you'll be able to process them in parallel.  By increasing the background sessions you can the sweet spot for acceptable background sessions.

  • Verified answer
    keoma Profile Picture
    32,727 on at
    RE: How to send 1000 E-mails within few seconds

    hi,

    nice thing. quick idea: i would develope a standalone (mail) windows service application, which connects to nav via nav web service call. the web service method should have a xml document as parameter. calling this method you assign the list of all these 1000 email addresses to the xml parameter (xmldom or xmlport). also add the pdf attachments. this mail service creates the needed mails and sends them. also possible (more efficient) create the pdf files (attachments) before you call the web service and save them to a shared folder, which is then used by the mail service. and ... if the mail addresses are always the same, send the list once to the mail service and go on.

    to have a really fast app, the mail service, should work with a couple of threads at the same time. so you could get a nearly realtime system.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans