How to send mail over extern SMTP Server from Exchange Online

Wladimir Monastir 20 Reputation points
2023-01-21T21:23:51.2766667+00:00

Hello, I have the following question. We have a mailbox on an external provider's SMTP server (A). Now we want to use M365 mailbox with Exchange Online (B) and send our mails via an email address of the server (A). As if we were sending the mails directly from the server (A). It is important especially because of the SPAM detection at the recipient. I heard that this is possible with transmit connectors. If this works, how do I have to configure the Exchange Server?

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
3,350 questions
Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,046 questions
{count} votes

Accepted answer
  1. Andy David - MVP 138.2K Reputation points MVP
    2023-01-22T22:38:08.9266667+00:00

    Ok, if you want to authenticate directly with Exchange Online, then no connectors are needed. My suggestions are for authenticating with the Server A on-prem and letting it route to Exchange Online.

    If you want to connect to directly to Exchange Online with IMAP, that wont work unless your client supports Modern Authentication. Basic Auth is no longer supported in Exchange Online

    [https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

    To Use IMAP, you would need a modern auth IMAP client:

    [https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth

    TO send via SMTP through Exchange Online, the tenant would need SMTP Auth enabled for your mailbox:

    Option 1 sounds like what you need:

    [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#option-1-authenticate-your-device-or-application-directly-with-a-microsoft-365-or-office-365-mailbox-and-send-mail-using-smtp-auth-client-submission

    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Andy David - MVP 138.2K Reputation points MVP
    2023-01-22T19:52:12.26+00:00

    Are you authenticating to Server A or sending a message through it anonymously?

    If authenticating, then you should be good and you just need to connect on port 587 to Server A with the credentials

    If sending anonymously through Server A, then a Server A Exchange Admin needs to create an application receive connector that you can relay through anonymously from your own server - scoped to the remote IP range of your sending server.

    You can do that following these:

    [https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/custom-receive-connectors?view=exchserver-2019#scenario-3-receive-messages-from-a-server-service-or-device-that-doesnt-use-exchange

    [https://practical365.com/exchange-2016-smtp-relay-connector/

    0 comments No comments

  2. Wladimir Monastir 20 Reputation points
    2023-01-22T22:03:17.8333333+00:00

    Hello Andy, we have credentials for an account on Server A. One Username (email) and password. I'm new on Exchange online.

    Which kind of connector I have to create on our new M365 Server (B)? In the connector configuration from M365 -> other server I cant define credential for Server A.

    And a further question. If it possible to define this configuration for separate e-mail-accounts?

    Example with separate credentials?

    emailA@serverB.com -> emailA@ServerA.com

    emailB@serverB.com -> emailB@ServerB.com

    Thanks in advance

    0 comments No comments

  3. Wladimir Monastir 20 Reputation points
    2023-01-22T22:13:15.39+00:00

    Hello Andy, we have credential for account on Server A (username and pass IMAP/SMTP).

    I'm new on Exchange online. Which kind of connector I have to create? In der send connector configuration page I cant find the right option where I can define credential for sending mails.

    Is it possible to configure this configuration for more than one e-mail-account on one M365 Server?

    Example with separat credentials

    emailA@ServerB.com -> emailA@ServerA.com

    emailB@ServerB.com -> emailB@ServerA.com

    Thanks in advance

    BR WM


  4. Wladimir Monastir 20 Reputation points
    2023-01-23T07:44:55.92+00:00

    Hi, I probably expressed myself too complex.

    We want to use Exchange online as the main system. So when I send a mail from M365 (server B), I want the actual mail to be sent via SMTP server A and not be detected as SPAM by the recipient. on SMTP server B we have a mailbox and the mails should be sent via this.

    And the second question would be, is it possible to do it with two mailboxes under one Exchange online M365 account.

    0 comments No comments