Hi Ron,
One may very likely have a problem with the number of e-mail addresses that
they feed to the SendObject function. However, I have done two test tonight,
and both ran flawlessly. The first test involved running the BulkEmail
function on 482 e-mail addresses (see my reply to AC). The string was 10,682
characters in length.
Then, I ran an append query 6 times, each time appending the table to
itself. Thus the first time, it added 482 records to the table. The second
time it added 964 records, then 1928 records, and so forth, doubling each
time. I ended up with 30,848 e-mail addresses. The BulkEmail function ran
just fine. The total length of the string was 683774 characters.
I'm sure that one would run into problems with most commercial ISP's long
before the limitations of the BulkEmail and/or SendObject were encountered.
For example, Comcast (my ISP) limits one to 49 (I'm pretty sure that is the
correct number) of e-mail addresses in an outgoing message.
Also keep in mind that with Tom's apporach ALL of the recepients will
see ALL of the other addresses.
Not necessarily true. If you used the To: parameter of SendObject this would
be true. And, it would be entirely appropriate in a small group within a
company.
However, there is nothing preventing one from using the BCC: parameter with
at least one valid e-mail address (sender's is a good choice) on the To:
line. The example I provided was just that: an example. It's up to the user
to make any necessary adjustments.
For 100's of e-mail addresses, I agree that sending them one-by-one is the
better choice. However, I would not do so using SendObject. At that point,
it's time to use something like Total Access E-mailer
(
http://www.fmsinc.com/products/Emailer/index.asp) or Fairlogic's WorldCast
(
http://www.fairlogic.com/worldcast/) to send out that many messages.
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
Ron2006 said:
The approach that Tom gave is a good one AS LONG AS THERE ARE NOT TOO
MANY ADDRESSES. I believe that at some time you will encounter a
problem with the number of characters that you can enter there.
At that point you have at least two choices.
Choice 1)
At this point in the code
With rs
Do While Not .EOF
strOut = strOut & ![BEMSID] & conSEP
.MoveNext
Loop
End With
instead of concatenating the addresses together, you would do the send
object using the email address of the individual. If you have 1,000
addresses you would send 1000 emails.
Choice 2)
Increase the logic at that point to add a counter and maybe concatenate
100 addresses and then send the message, clear the strOut field and
counter and start the concatenate process again. Don't forget to send
another message at the eof condition to get the last set of 1 to 99
addresses that are there but have not yet received the email. In this
situation 1000 addresses will get you 10 or so email messages. In this
situation you should be aware that ALL of the recepientes will ALSO see
the email address of all of the other 99 recepients and you have to
have at least 1 actual address in the to: address.
Also keep in mind that with Tom's apporach ALL of the recepients will
see ALL of the other addresses.
Ron.