I have implemented SMTPsecureSocket as a Control object on a webpage object.
I have a method in the webpage which initialises the socket, creates the message queue by looping repeated .messages.append(mymessage) from a database list.
Then invoke the .sendmail command.
The Socket has event handlers for all available events (ConnectionEstablished / Error / MailSent / MessageSent / ServerError). These handlers write data into various “Properties” of the webpage. (ie message counters / error codes etc)
I then trigger a WebTimer (a control on the webpage). The timer action event periodically inspects the webpage properties to monitor any outputs placed there by the Socket event handlers, and sends updates to the UI as required (ProgressBar / Error messages /etc…).
This all worked very well, until recently…
The database has slowly grown in size, and now has over 200 members’ email addresses.
I now observe the following behaviour:-
A simple “1-line” message sends perfectly to all members.
A larger “50-line” message sends perfectly to approx 100 members, but if we try to send such a message to all 200, the socket seems to “hang”. No messages are sent, but no Socket events are fired (Except ConnectionEstablished). It just sits there doing nothing. No errors, nothing sent.
But guess what? If I add a socket.poll command in my Timer action, the first message gets sent. If I repeat the .poll the next message gets sent, and so on, until around half the queue has been sent. After this point, the sending speeds up and all remaining messages get sent regardless of .poll frequency.
I would love to understand what is going on! Am I doing something wrong?