Application Integration to send mail using Office 365

Anand R. Menon 1 Reputation point
2022-12-20T09:55:31.713+00:00

Hi Team,

We are trying to setup a mail server in our internal application using Office 365. The method we're following for the same is SMTP AUTH client submission which is mentioned below:
https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365

After the setups, while we're trying to send test mail, we're getting an error, "Failed to connect to mail server: timeout".

Do we need to enable any setting at Office 365 end to resolve this error? Thank you.

Regards,
Anand R Menon

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Windows for business | Windows 365 Enterprise
{count} votes

2 answers

Sort by: Most helpful
  1. Aholic Liang-MSFT 13,921 Reputation points Microsoft External Staff
    2022-12-21T06:47:46.817+00:00

    Hi @Anand R. Menon ,
    If your tenant was created on or after October 22, 2019, security defaults may be enabled in your tenant.
    Please refer to the following link to disable it in your tenant and see if it works:
    Fix issues with printers, scanners, and LOB applications that send email using Microsoft 365 or Office 365 | Microsoft Learn
    Here is a similar thread for you reference: 535 5.7.139 Authentication unsuccessful - Microsoft Q&A


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Amit Singh 5,316 Reputation points
    2022-12-21T10:35:29.82+00:00

    The resolution for this error is quite simple; the user must check the network connectivity to ensure that the SMTP client has unrestricted access to the SMTP server over port 25. If the ISP or administrators intentionally deny port 25, the best alternative is to use port 587, which supports SMTP with encryption.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.