• Login
  • Register

DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Send Bulk emails with one Client

You are not authorized to post a reply.

New Member

New Member

    Hello everyone,

    I'm really stuck right now and I hope someone here can help me.  Our site sends many emails at one time for notificaitons.  When we send the emails, not all emails are sent.  For example we need to send 200 emails out.  We call the DotNetNuke.Services.Mail client to do this.  The issue is that after a certain number (Which seems random) the system stops sending.  We are using Google and they said the issue may be that we should use just one email client to send the emails.  

    It seem that DNN creates a new client every time an email is sent

     using (var smtpClient = CreateSmtpClient(smtpInfo, host, port))

         foreach(var mailMessage in messages){



    Is there a method to use where a single SMTP client is created, THEN the emails are sent?


    After a number of emails are sent (In this example 91 were successfully sent) then the following error is registered for each of the next 99 emails:



    DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke










    Message:Unable to read data from the transport connection: net_io_connectionclosed.


       at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
       at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
       at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
       at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)











    Server Name: WEB_SERVER_1






    Veteran Member

    Veteran Member

      For addressing all members of a DNN role, there is a sendBulkmail method, which is used by the newsletter module. You may follow the implementation of the Newsletter module, source code can be found at https://github.com/DNNCommunity/DNN.Newsletter.

      New Member

      New Member

        As always Sebastian, 

        Thanks for being such a huge support.  I will look into their method.


        Veteran Member

        Veteran Member

          You are welcome, thanks a lot!

          New Member

          New Member


            Just thought I would update this topic for anyone who has a similar question or issue.

            We are using G-suite from Google.  We moved to Google from GoDaddy because we were limited to the number of relays per day.  Our company is growing, and it was too expensive to add relays from GoDaddy.

            Originally we were sending one email per session, but Google limited the number of sessions, and would block any additional sessions.

            We started using the bulk email with tokens code within DNN (We are using 9.8.1) and still had a similar issue.  It turns out Google sets a limit of 100 SMTP email address sends per session.  We have a TO and a CC, so that was counting as 2 sends.  The session would close as soon as we got close to the 100 (It was never an exact number).

            We are looking into a provider where we can send our emails via the DNN SMTP client.  (In addition to the normal DNN email, the administrators of each portal send a weekly news letter, emails blasts to either the whole directory or a portion.

            Just to throw it out there,  What are people using to send out emails to their customers?  Has anyone else had to use an SMTP email provider because their site is sending too many emails?

            Just for full discolsure:  THIS IS NOT SPAM EMAIL.  These are customers who expect to recieve these emails.




            New Member

            New Member

              I use the SMTP service from sendpulse and find it reliable and cheap


              Veteran Member

              Veteran Member

                I also suggest using a 3rd party email service like SendGrid or any of its competitors.
                You are not authorized to post a reply.

                These Forums are dedicated to discussion of DNN Platform.

                For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
                2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                4. No Flaming or Trolling.
                5. No Profanity, Racism, or Prejudice.
                6. Site Moderators have the final word on approving / removing a thread or post or comment.
                7. English language posting only, please.

                Would you like to help us?

                Awesome! Simply post in the forums using the link below and we'll get you started.

                Get Involved