Tracking down email errors

I am currently using SMTPSecureSocket to send batches of emails to our email provider but have been getting some intermittent issues. The number of emails varies but my process creates a single instance of the socket and sends the whole batch at once. Most of the time (say 75%) I have no issues within a few seconds each SMTPSecureSocket.MessageSent event that is expected and the SMTPSecureSocket.MailSent event have fired, occasionally the SMTPSecureSocket.ServerError event fires and I handle that, but far too often for an app in production, I do not get any response. No events are raised. My app checks for “stale emails” at the beginning of its process, and attempts to resend these emails. It also logs this and at times this problem will perpetuate for hours at a time.

If anyone has any experience with this issue, I’d appreciate their input, but I’m mainly looking for ideas on what else to consider. I handle Error, MailSent, MessageSent and ServerError, but is there anything else for which I should be looking?

Note: I am currently working with our email provider to see if there are any issues they can identify on their end.
Also: A similar process is in production using a Filemaker App and issues related to the volume of messages, the frequency of messages and the number of recipients have been addressed, my Xojo app is sending just a couple emails at any given time and only to one or two of our internal email addresses (hosted by the same provider), so I don’t think that it’s spam filter related.

First thought is your mail server throttles you.

Use MailChimp, SendGrid or anyone else to send the mails for you. Very likely you run into throttling.

@Phillip Zedalis and @Beatrix Willius We’ve already worked with our email provider to take off the limits or at least raise them enough that it has yet to be a problem in our Filemaker solution. I’ve been going back and forth for a day with their support group to see if there’s anything else going on on their end. I find it awfully strange that no events are returned.

This morning I discovered another bizarre behavior: I run the application on a dedicated machine, and I pulled up a debug version on my machine to inspect the socket properties further (since I was hoping that the debug version would not send and I’d get a chance to dig deeper), and it sent no problem. The very next run of the production app ran no problem. I’m not sure what to make of that.

Well, I apprehensively say I think I’ve sorted out the issue. It seems that Xojo’s SMTPSecureSocket does not handle sleeping (even display sleeping or screen savers) well. For some reason, it thinks it has sent the email but, events are never raised. The strange part is that the app sends alerts to a Slack channel and has no problem doing so, even if the machine’s screen is sleeping. Even more so, a Xojo Console app in the same environment has no problem if the display sleeps. So I have turned off all power saving settings on the machine hosting my application and will let it run for another week or so before I declare the problem fixed.