DNN Forums

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

Send Bulk emails with one Client

Sort:
You are not authorized to post a reply.





New Around Here





    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){
              smtpClient.Send(mailMessage);

         }
     }

     

    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:

     

    AbsoluteURL:/desktopmodules/CVRegistration/Service.asmx/BulkEmail

    DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke

    ExceptionGUID:2890f113-c87d-4a59-91c3-3c81eb684ad1

    AssemblyVersion:

    PortalId:-1

    UserId:-1

    TabId:-1

    RawUrl:

    Referrer:

    UserAgent:

    ExceptionHash:UPlHF73t/GGpNtFq7LermfBUt9Y=

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

    StackTrace:

       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)

     

    InnerMessage:

    InnerStackTrace:

    
     

     

    Source:System

    FileName:

    FileLineNumber:0

    FileColumnNumber:0

    Method:

    Server Name: WEB_SERVER_1

     

     

     

     

     






    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 Around Here





        As always Sebastian, 

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

        Joe






        Veteran Member





          You are welcome, thanks a lot!





          New Around Here





            OK,

            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.

             

            Thanks!!

             






            Growing Member





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

               






              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 the 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. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                3. 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.
                4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                5. No Flaming or Trolling.
                6. No Profanity, Racism, or Prejudice.
                7. Site Moderators have the final word on approving / removing a thread or post or comment.
                8. 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