SMTP relay settings for O365

Ghulam Abbas 211 Reputation points
2023-06-22T17:18:57.18+00:00

Hi, we will be migrating from on-prem Exchange to Exchange online. We have several systems and applications that currently use our internal smtp relay to send email notifications. We will need to change this to O365 smtp using basic / modern authentication method. We have created a service email account that we will be using as authentication (as login account). As a test, when we use smtp.office365.com (port 25 / 587) with username / password (this new service email account), we get the error "unable to connect to SMTP server because of invalid credentials or connection settings". We have SMTP Authentication disabled at the organisation level but tried to enable it for the mailbox that we use for basic authentication testing as a logon user. Can we please get some suggestions?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,185 questions
Exchange | Exchange Server | Management
Exchange | Hybrid management
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points MVP Volunteer Moderator
    2023-06-22T19:05:57.5733333+00:00

    Why not continue to use the internal SMTP relay and create a connector to it from on-prem to 365 instead?

    That way you can lock down 365 to modern auth and disable SMTP auth at the tenant level.

    https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/use-connectors-to-configure-mail-flow/set-up-connectors-to-route-mail


  2. Kael Yao 37,746 Reputation points Moderator
    2023-06-23T01:35:00.7466667+00:00

    Hi @Ghulam Abbas,

    Please refer to the following link for detailed guide:

    How to set up a multifunction device or application to send email using Microsoft 365 or Office 365

    In short, if you would like to use basic authentication, you may need to disable security defaults.

    (Security defaults works on tenant-level so even if you enable SMTP auth for a specific mailbox, it still doesn't work)

    If possible please consider using modern auth or refer to Option 3 in the link to create a receive connector for the devices and applications.


    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.


  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  4. Lucas Igbins 0 Reputation points
    2024-01-11T22:16:02.8366667+00:00

    @ghulam abbas How do you resolve/solution this? We have similar environment and we be use same setup for internal and external application.

    0 comments No comments

Your answer

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