Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default PAUSE CFMAIL

    Hi All

    Have a need to pause the mail send using cfmail for a short period (15 sec)
    after every 200 emails sent. A fellow pointed out this

    <cfset thread = CreateObject("java", "java.lang.Thread")>
    About to sleep for 5 seconds...<cfflush>
    <cfset thread.sleep(5000)>
    Done sleeping.

    My question is how do I apply it??

    Do I add this to the mail tag??

    I'm using CF7 and the mail tag like this

    <cfmail query="rsMyMailQuery"
    from="#My@name.com#"
    subject="#txtSubject#"
    to="#Your@name.com#"
    server="#MailServer#"
    timeout="9000"
    replyto="#My@name.com#"
    failto="#Support@name.com#">

    Any pointers would be greatly appreciated

    Bill



    Bill Guest

  2. Similar Questions and Discussions

    1. <cfmail></cfmail> in a script
      I am wondering if I can put <cfmail> tags and code within a javascript script. will the browser recognize it, and perform the instructions? ...
    2. cfmail and pause
      hi, i am on a shared hosting server and they have limits for sending bulk emails. I found this code and it seems to do the pause nicely, but...
    3. cfmail - Attribute validation error for tag CFMAIL.
      I'm getting the error ' Attribute validation error for tag CFMAIL.' on the code below. All its doing is outputting a text string to the TO: field. ...
    4. Pause a gif
      I am making a screen in Director 7 for children at school to investigate buttons. I want to have a screen with still gifs and when buttons are...
    5. pause all
      The following pause action: function funcAll(mc, func) { mc.func = func; mc.func(); for (childMC in mc) { if (typeof (mc) == "movieclip") {...
  3. #2

    Default Re: PAUSE CFMAIL

    On 2005-06-04 00:41:53 -0500, "Bill" <bill.betournay<SpamTrap>@gmail.com> said:
    > Hi All
    >
    > Have a need to pause the mail send using cfmail for a short period (15
    > sec) after every 200 emails sent. A fellow pointed out this
    >
    > <cfset thread = CreateObject("java", "java.lang.Thread")>
    > About to sleep for 5 seconds...<cfflush>
    > <cfset thread.sleep(5000)>
    > Done sleeping.
    The gist of how you would apply this would be to do a check for the
    current query row in your cfmail loop and if it's divisible by 200, run
    that code. I can't test this right this second but something like this
    should work:

    <cfmail query="myquery" from="whatever" to="whatever">
    Mail content goes here.
    <cfif myquery.CurrentRow MOD 200 EQ 0>
    <!--- stick sleep code in here --->
    </cfif>
    </cfmail>

    If that current row stuff doesn't seem to do the trick you could also
    just stick a simple counter in your cfmail tag and increment it on each
    pass.

    Hope that helps,
    Matt
    --
    Matt Woodward
    [email]mpwoodward@gmail.com[/email]
    Team Macromedia - ColdFusion

    mpwoodward *TMM* Guest

  4. #3

    Default Re: PAUSE CFMAIL

    Hi mpwoodward

    Thanks for the reply.

    I just now saw your reply and haven't tested it yet. You're saying that this
    example will pause at the end of every 200 mails sent and resume the send
    process with the vary next record pulled from the db. If I have 5000 email
    addresses being queried they will all get sent and no email address will
    receive two newsletters.

    I need to make sure because I have no means of testing unless I create a
    deplicate db table with several hundred records of my own email address. I
    only have a live db for testing.

    Bill


    "mpwoodward *TMM*" <mpwoodward@gmail.com> wrote in message
    news:d7sge3$2u7$1@forums.macromedia.com...
    > On 2005-06-04 00:41:53 -0500, "Bill" <bill.betournay<SpamTrap>@gmail.com>
    > said:
    >
    >> Hi All
    >>
    >> Have a need to pause the mail send using cfmail for a short period (15
    >> sec) after every 200 emails sent. A fellow pointed out this
    >>
    >> <cfset thread = CreateObject("java", "java.lang.Thread")>
    >> About to sleep for 5 seconds...<cfflush>
    >> <cfset thread.sleep(5000)>
    >> Done sleeping.
    >
    > The gist of how you would apply this would be to do a check for the
    > current query row in your cfmail loop and if it's divisible by 200, run
    > that code. I can't test this right this second but something like this
    > should work:
    >
    > <cfmail query="myquery" from="whatever" to="whatever">
    > Mail content goes here.
    > <cfif myquery.CurrentRow MOD 200 EQ 0>
    > <!--- stick sleep code in here --->
    > </cfif>
    > </cfmail>
    >
    > If that current row stuff doesn't seem to do the trick you could also just
    > stick a simple counter in your cfmail tag and increment it on each pass.
    >
    > Hope that helps,
    > Matt
    > --
    > Matt Woodward
    > [email]mpwoodward@gmail.com[/email]
    > Team Macromedia - ColdFusion
    >

    Bill Guest

  5. #4

    Default Re: PAUSE CFMAIL

    The problem with using any sleep tag is it ties up a ColdFusion process. Since
    you only have so many processes available to handle your traffic, this may may
    not be so bad or it may be a disaster depending on server load and
    configuration. Also this is going to be one LONG running request... You will
    need to build in some sort of failure recovery for if it bombs out in the
    middle of the run for some reason.

    My longtime solution to this has been to run mail through a "trickler". Its
    never failed me. Not so long ago I built failure recovery into it.

    [url]http://mysecretbase.com/Slowing_Down_CFMail_2004.cfm[/url]

    --Matt--
    MSB Web Systems... [url]http://mysecretbase.com[/url]
    "When in doubt, mumble.
    When in trouble, delegate.
    When in charge, ponder."
    - Senator. David Boren


    MattRobertson Guest

  6. #5

    Default Re: PAUSE CFMAIL

    Now that is exactly what I was looking for. You're the best Matt. Thanks you
    so much.

    Bill


    "MattRobertson" <theking@mysecretbase.com> wrote in message
    news:d85h8u$cn2$1@forums.macromedia.com...
    > The problem with using any sleep tag is it ties up a ColdFusion process.
    > Since
    > you only have so many processes available to handle your traffic, this may
    > may
    > not be so bad or it may be a disaster depending on server load and
    > configuration. Also this is going to be one LONG running request... You
    > will
    > need to build in some sort of failure recovery for if it bombs out in the
    > middle of the run for some reason.
    >
    > My longtime solution to this has been to run mail through a "trickler".
    > Its
    > never failed me. Not so long ago I built failure recovery into it.
    >
    > [url]http://mysecretbase.com/Slowing_Down_CFMail_2004.cfm[/url]
    >
    > --Matt--
    > MSB Web Systems... [url]http://mysecretbase.com[/url]
    > "When in doubt, mumble.
    > When in trouble, delegate.
    > When in charge, ponder."
    > - Senator. David Boren
    >
    >

    Bill Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139