Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 6

Office365 SMTP not working

Solved! Go to Solution.

I am trying to send SMTP email from the Linux mailx command; however, no matter how I try, the return from the server is always Authentication unsuccessful.

I did:

- Setup connector in Office 365 exchange to add my public IP addresses as trust

- Setup an Office 365 account with an Essential subscription

- Allow incoming & outgoing SMTP traffic over port 25 and 587 on my firewall for all Office365's IP addresses

I tried to run:

mailx -v -s "Now is `date`" \
-S smtp-use-starttls \
-S ssl-verify=ignore \
-S smtp-auth=login \
-S smtp=smtp:// \
-S from="" \
-S smtp-auth-user="" \
-S smtp-auth-password="password" \
-S ssl-verify=ignore \ 

 And I always get the return below from the Office365 server.

535 5.7.3 Authentication unsuccessful [YQBPR0101CA0032.CANPRD01.PROD.OUTLOOK.COM]
smtp-server: 535 5.7.3 Authentication unsuccessful [YQBPR0101CA0032.CANPRD01.PROD.OUTLOOK.COM]
"/root/dead.letter" 11/388
. . . message not sent.

 I tried to change the following variables:

- Substitute with resolved IP address

- Port 25 with port 587

Substitute smtp-auth-user="" with smtp-auth-user="\myname"



Is there anyone successfully manage to get mailx working with Office365 SMTP?

5 Replies
Community Manager
Message 2 of 6

Re: Office365 SMTP not working

Hi @pasi123456,


This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.


As you’ll notice, your Topic is now in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.



Be sure to click Accept as Solution to mark helpful posts to help other users locate important info. Also, don't forget to give Kudos for great content!

Copilot Lvl 3
Message 3 of 6

Re: Office365 SMTP not working

I tried with telnet mail from in Windows PowerShell command and this is the result.2018-06-12 13_58_09-.jpg




Copilot Lvl 3
Message 4 of 6

Re: Office365 SMTP not working


I found the resolution.

The issue is at the MX record's IP address was not allowed in the firewall.

Also I had to request for IP and domain white listing in the Spamhaus.


Just for record, the SMTP Diag Tool at does work for Office365 SMTP testing.

Ground Controller Lvl 1
Message 5 of 6

Re: Office365 SMTP not working

@pasi123456Dear friend,

This is a new issue for me (perhaps just coincidental - following a recent OS upgrade from Windows 10 Home to Windows 10 Pro).  An Windows 10 OS patch for January 2020 that I just installed also solved one other mail related issue for me that had popped up unexpectedly since last week.  Would you please explain the solution you're referring to in simple "layman's English" - that is, without using too much technical lingo?  More specifically, what are all the steps required to request for IP and domain white listing in the Spamhaus?  For reference, I am simply trying to send automated email messages using a Python program (which worked beautifully and perfectly up until my OS switch/upgrade to Windows 10 Pro) but apparently the email server is no longer recognizing my Hotmail / Outlook email account credentials.  It's become a major headache for what I am trying to accomplish, especially after spending many hours/days to successfully figure out the programmatic email solution just days before the OS switch/upgrade.  Your timely help will be greatly appreciated.  Please note that I am not a naturally techie person but learning new things everyday.  So simpler explanation in plain English is preferred.  Sincere thanks in advance. R

Ground Controller Lvl 2
Message 6 of 6

Re: Office365 SMTP not working

The following answer helped me out in resolving my issue.On the contrary
I have another query in this regard that I am going through a problem that whenever
I am going ahead and trying to sign in to a Microsoft cloud service such as Office 365,
Microsoft Azure I am getting the following error message from
ADFS that "There was a problem accessing the site. Try to browse to the site again."I have contacted
the help desk and followed out their guidelines as told office 365 login .Suggest us if anything
I have missed out.