View the original community article here
Last tested: Jan 31, 2020
If you're following these steps, and running into a "Failed to send mail: end of file reached" error, you are probably using
smtp.office365.com as your Mail Server rather than your specific MX server.
To find the MX server for your domain: type nslookup, then set type=mx, then enter your domain name. For example, if your domain name is lookertest.com:
> set type=mx
lookertest.com mail exchanger = 0 lookertest-com.mail.protection.outlook.com.
Authoritative answers can be found from:
From this example the MX server is "lookertest-com.mail.protection.outlook.com".
You can then enter this as the Mail Server, and the error should resolve.