Written by

Senior Analyst at WoodWare Systems
Question David Hockenbroch · Nov 8, 2024

Debugging %Net.SMTP Requests

I'm having an issue with sending SMTP requests from a specific Microsoft 365 account to Gmail accounts. We can use other Microsoft 365 accounts, but something about this one specific account sending to Gmail fails. The error we get is just telling us that sending to the user xxxxx@gmail.com failed. In order to troubleshoot that, I'm looking for more detail than that.

I see %Net.SMTP objects have a Debug property, but when I set it to 1, I can't see anything happening differently. What does that debug value do? And is there any way to see a more fully detailed SMTP response that I'm just overlooking?

Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1.2 (Build 574U) Fri Jan 13 2023 14:58:02 EST

Comments

Enrico Parisi · Nov 8, 2024

What's the status returned by the Send() method of %Net.SMTP class?
I believe it should contain some info.

0
David Hockenbroch  Nov 11, 2024 to Enrico Parisi

That also just gives the generic "Sending failed to all recipients" message.

0
Alexander Koblov · Nov 11, 2024

Hi David.

Take a look in the %Net.SMTP:GetResponse method.

There is a commented out "#define SMTPTRACE" macro. Uncomment it, recompile %Net.SMTP

Reproduce the error, then check ^SmtpTrace global

Hopefully it should have some details on the interaction with the SMTP server.

Do this on the TEST instance, as each %Net.SMTP:Send clears out the debug global.

0
David Hockenbroch  Nov 12, 2024 to Alexander Koblov

Thanks, that's exactly what I needed to see!

0