sending multiple emails

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default sending multiple emails

    I am re-writing code that sends an email out to whoever has subscribed to a
    particular page on my sites. The problem is there's three ways to do it, and
    the info is kept in three different tables in the db (different levels of
    interest in the content: all content on the whole site, just for a particular
    set of pages, or just this one page). In the past I would just generate a
    giant BCC list from all three sources and remove dupes before running the
    cfmail tag. However, I've found that this is very unreliable. A single bad
    email could stop the sending of the whole list, or stop the sending from the
    bad address on in the list. So I'm rewriting this section of the code. I could
    cfloop through the giant list, but I imagine launching CFMAIL potentially
    hundreds of times would make for a VERY slow posting time. I'd prefer to use
    the query results, but the three queries can't be combined into one query at
    runtime, so I'd still have to launch CFMAIL three times. Not so bad, but still
    I'd prefer to do it just once. So I guess my question is this: is it worth the
    CPU time to try to combine the three query record sets into one record set
    (after they run individually) and run CFMAIL once, or just run CFMAIL three
    times and be done with it? This is one of the more popular features of the
    site so this code would be hit rather frequently.

    michaelmuller Guest

  2. Similar Questions and Discussions

    1. CFMAIL sending two emails
      Sounds like you are experiencing a different problem than I was...
    2. CFMAIL sending two emails
      2nd attempt to post this. I hope they plan on improving these forums. They use to be great! Ok, I've turned 'Spool mail messages for delivery'...
    3. CFMAIL sending two emails
      I'm going to give these suggestions a try now. The weird thing for me is it is only sending double emails to the cc recipient. Thanks guys.
    4. CFMAIL sending two emails
      My problems went away by disabling the 'use mail spooler' option in the CF administrator. Have you tried this? Oddly, my double email problem is...
    5. CFMAIL sending two emails
      I'm having this same problem as well on a standard Win 2000 server. CF MX 6.1. Any advice would be appreciated.
  3. #2

    Default Re: sending multiple emails

    I've used CFMAIL to send thousands messages, each with a separate call to
    CFMAIL (looping). i had to do this because each message is personalized. The
    issue is not really CFMAIL, but the server on which it runs and the SMTP
    server. If they are decent and can handle the load, then this approach is no
    big deal. A few thousand messages go out on my box in less than a minute. I
    would suggest doing a little testing if that is feasible on your system.
    Unless your machine is under load, I don't think you will notice much
    difference between all three methods.

    Bryan


    blewis Guest

  4. #3

    Default Re: sending multiple emails

    michaelmuller wrote:
    > I am re-writing code that sends an email out to whoever has subscribed to a
    > particular page on my sites. The problem is there's three ways to do it, and
    > the info is kept in three different tables in the db (different levels of
    > interest in the content: all content on the whole site, just for a particular
    > set of pages, or just this one page). In the past I would just generate a
    > giant BCC list from all three sources and remove dupes before running the
    > cfmail tag. However, I've found that this is very unreliable. A single bad
    > email could stop the sending of the whole list, or stop the sending from the
    > bad address on in the list. So I'm rewriting this section of the code. I could
    > cfloop through the giant list, but I imagine launching CFMAIL potentially
    > hundreds of times would make for a VERY slow posting time. I'd prefer to use
    > the query results, but the three queries can't be combined into one query at
    > runtime, so I'd still have to launch CFMAIL three times. Not so bad, but still
    > I'd prefer to do it just once. So I guess my question is this: is it worth the
    > CPU time to try to combine the three query record sets into one record set
    > (after they run individually) and run CFMAIL once, or just run CFMAIL three
    > times and be done with it? This is one of the more popular features of the
    > site so this code would be hit rather frequently.
    >
    We have an email marketing app that sends sometimes thousands of emails
    (opt-in, not spam ...) and I send each e-mail individually in a loop
    that calls cfmail for each iteration. It does take some time to run
    this process but since this is something that runs behind the scenes (at
    least I'm assuming), is that a problem?

    I'd at least do some tests in your environment and see how it performs.
    I've been very surprised at just how fast cfmail is, particularly if
    you have a speedy mail server (and even speedier if you're running CF
    Enterprise).

    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  5. #4

    Default Re: sending multiple emails

    I can't afford a full minute to post. These are website community members
    posting messages and files, etc, with an email alert going out. If, upon
    clicking the submit button, it takes a full minute for the page to come back
    they'll think the site is broken and they'll click the button again. I found
    a udf that merges queries and am trying that. I think this'll be a little
    faster than lopoing around a cfmail. Perhaps we could run a test? Vroom vroom!

    michaelmuller Guest

  6. #5

    Default Re: sending multiple emails

    michaelmuller wrote:
    > I can't afford a full minute to post. These are website community members
    > posting messages and files, etc, with an email alert going out. If, upon
    > clicking the submit button, it takes a full minute for the page to come back
    > they'll think the site is broken and they'll click the button again. I found
    > a udf that merges queries and am trying that. I think this'll be a little
    > faster than lopoing around a cfmail. Perhaps we could run a test? Vroom vroom!
    >
    Either that or don't send the emails right when someone updates the
    page. Sounds like this would be a good candidate for storing the fact
    that the page was updated in the background and running a scheduled job
    to send out the emails every few minutes. Sometimes doing things
    literally in real time can be more trouble than it's worth if true
    real-time notifications aren't essential.

    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  7. #6

    Default Re: sending multiple emails

    The querymerge() udf I found on cflib doesn't work, or at least I can't get it
    to work and I'm too tired right now to write my own, so maybe I'll just make a
    list for the time being and loop over it. If anyone out there knows of a tag
    or udf that merges two queries please let me know. I'm surprised it's not built
    into CF. Hey, Macromedia. Modify CFMAIL in the next update (if 7 doesn't
    already do this) that will accept a list and a structure as well as a query.
    Email is still the #1 killer app. Build in advanced checking as well (query
    the receiving mail server if the account is valid).

    michaelmuller 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