CDO COM - slow script execution when sending email to multiple recipients

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wodzu
Posts: 9
Joined: 06 Dec 2018, 02:21

CDO COM - slow script execution when sending email to multiple recipients

03 Feb 2020, 13:17

Hi all,

I'm using the CDO Com scripting for sending emails using a corresponding SMTP server. Bunch of recipients (ca. 30) are stored in a variable: and then triggered by a standard command:

Code: Select all

pmsg.To := ListOfUsers
Unfortunately, it takes a long time to execute this particular part of the code. I noticed such regularity, that the more recipients the slower the script execution.

Is it a commonly known problem or maybe there is a different way to send emails to multiple recipients?
wodzu
Posts: 9
Joined: 06 Dec 2018, 02:21

Re: CDO COM - slow script execution when sending email to multiple recipients

03 Feb 2020, 15:30

flyingDman wrote:
03 Feb 2020, 13:48
How long does it take?
Also you are presumably using (i.e. in quotes)
It takes about 3-4 minutes for ca. 30 recipients.

If i set it between quotes I'll become an error message:

0x8004020C - At least one recipient is required, but none were found.

Code: Select all

pmsg.To := """" ListOfUsers """"
@It's funny, because when I set a single recipient between quotes then it works perfectly, but with more recipients it's showing the above mentioned error...

@@It works like by setting the double quotes like that:

Code: Select all

pmsg.To := "". ListOfUsers .""
but it takes the same time to send it to all recipients.
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: CDO COM - slow script execution when sending email to multiple recipients

03 Feb 2020, 16:01

wodzu wrote:
03 Feb 2020, 15:30
If i set it between quotes I'll become an error message
If you don't use quotes with the := operator, AHk should throw an error: The leftmost character above is illegal in an expression.

if you need a quoted list:or using the = operator:
User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: CDO COM - slow script execution when sending email to multiple recipients

03 Feb 2020, 16:24

Yes, that seems to be excessively long (although I have never tried 30 addresses). As small email with a small .txt attachment to 2 addresses takes 3 seconds.
I use:

Code: Select all

rec := "[email protected], [email protected]"
;...
pmsg.To := rec
14.3 & 1.3.7

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 222 guests