I am successfully running a Send-MailMessage. I was wondering if there is any way to log everything like smtp logs. Unfortunately, all my tests failed.
Do you know of any way?


P.S. Or do I understand it wrong? I am expecting to see which MX was found for the recipient, what was the server response etc.

Between your client and your SMTP server, there’s nothing happening related to looking up MX records. You just send the message to the SMTP server and tell it the recipients; it says “OK” and the connection is ended. If you want to know what happened between the SMTP server and the recipient, you’d have to have some sort of logging on the server (and even then you might not get everything; emails sometimes wind up passing through more than one relay.)

Thank you for the reply Dave.
I was thinking the same…when specifying the Credentials, powershell will actually submit the mail item to the mailbox server and afterwards it will go through the transport agents and get submitted to the recipient…hence, no details for this cmdlet.

Best regards