6 Replies Latest reply on Oct 20, 2006 8:31 AM by Newsgroup_User

    NewsLetter type of application

    TommyMTL
      Good day,

      I am building a simple NewsLetters type of application and need to email the templte filled out of DB information. This is not a problem but I find a problem when I am sending out the template. My DB contain 600 email adresses. The problem I have is, it seams that CF 7MX is not sending 1 email per adresse so my logs reports that sometimes 90 emails are sent and sometimes 200 but it seams that It is not going true my entire listing.

      Does anyone have a potential solution for that?

      My code is like:

        • 1. Re: NewsLetter type of application
          Level 7
          Is that really close to what your mail server is name or did you tweek that
          for this example. Mine is something like mail.mailserver.com.
          Might not help you answer right now, but that is making me curious and just
          wanted to know. I haven't seen a @ symbol in a mailserver address.


          • 2. Re: NewsLetter type of application
            Level 7
            I wonder if your email server is having problems with sending them in loads?
            I have a mailer system that sends out 5,000 per run and has no problem. I
            also had to build a delay into the loop so it sends in 200 email blocks.

            Your code seems to be fine, except I am not sure how accurate the
            spoolEnable is and how it actually works.

            My impression was, and I am sure I am mistaken, when looking at the CF
            admin, it was telling me that it looks for new emails to send every 15
            seconds, no matter how many are ready to go. So, if you system is 'good' it
            could have all 600 emails ready to go at once which could choke your
            mailserver. Again, I might be wrong, I am not the System Administator... :-)


            • 3. Re: NewsLetter type of application
              TommyMTL Level 1
              Hi Wally,

              The server name is not blablabla.ca just a tweek for diplaying code on this forum.

              This is exactely my question about the delay. How do you build it?
              My server is quit robust 8 processors 16 Gig ram on a T3 line, so it should handle it no problems
              • 4. Re: NewsLetter type of application
                Level 7
                I am sure mine is not the most graceful, but it works. It does run on the
                client side so it hangs the page and needs to keep open, but should be that
                bad for a short run like 600.

                After the last </cfmail> and before the </cfloop> I put:

                <cfset i = i + 1>
                <cfset t = Now()>
                <cfset nt = Now()>
                <cfif i GT 200>
                <cfloop condition="nt LTE t + (1/1440)">
                <cfset nt = Now()>
                </cfloop>
                <cfset i = 0>
                </cfif>

                It counts the mails up to 200.
                When it reaches 200, it sets t and 'nt' to Now().
                Then it 'asks' does nt = t plus 1 minute.
                If not, it loops nt till it reaches 1 minute.
                When it does it sends off another 200 emails.

                That works for my mailserver.

                So in your code it would be something like:
                <cfloop query="DistributionListEmail">
                <cfset i = 0>
                <cfmail to = "#DL_Email#" from = "info@blablabla.ca" subject = "Message"
                spoolenable="yes" failto="info@blablabla.ca" replyto = "info@blablabla.ca"
                type = "html" debug = "no" charset="iso-8859-1"
                server="info@blablabla.ca" username="admin" password="mailout">

                My content

                </cfmail>
                <cfset i = i + 1>
                <cfset t = Now()>
                <cfset nt = Now()>
                <cfif i GT 200>
                <cfloop condition="nt LTE t + (1/1440)">
                <cfset nt = Now()>
                </cfloop>
                <cfset i = 0>
                </cfif>
                </cfloop>


                • 5. Re: NewsLetter type of application
                  TommyMTL Level 1
                  This is greate

                  Can you set time delay somewhere?
                  • 6. Re: NewsLetter type of application
                    Level 7
                    The 1/1400 is the time delay. ( 1 minute) You can set it to anthing you like
                    either statically or dynamically.

                    Here is the formula.

                    60 minutes in an hour * 24 hours in a day = 1440

                    1/1400 is 1 minute