How to Set SMTP relay on iis , useing 365 mail

Shai derhi 1 Reputation point
2022-04-27T07:45:45.36+00:00

Hi everyone, I have a problem with setting up a virtual smtp on my IIS server 2019..
I want it to be compatible with my 365 mailbox, and unfortunately I have not found any solutions online :(

First of all, what are the settings that should be in IIS (according to 365)?
In outbond connection tcp port 587/25?
I have already created a connector in 365 admin, I need to insert the MX somewhere?

step by step will be amazing!!!
Tnx for help!

Windows development | Internet Information Services
Exchange | Exchange Server | Management
{count} votes

2 answers

Sort by: Most helpful
  1. Kael Yao 37,746 Reputation points Moderator
    2022-04-28T06:09:55.713+00:00

    Hi @Shai derhi

    Did you follow the steps in this link to create a receive connector?
    If yes, here is my configuration in IIS SMTP server:

    1. In General, add local ip address of the IIS SMTP server and listen on port 25
      197231-01.png
    2. In Access>Access control, select Anonymous access
      197099-02.png
      In Access>Relay, add the ip addresses of the devices which are allowed to relay via the IIS SMTP server
      197130-03.png
    3. In Delivery>Outbound Security, select Anonymous access
      197100-04.png
    4. In Delivery>Outbound connections, configure TCP port to 25
      197150-05.png
    5. In Delivery>Advanced, configure Smart host to be the MX record of your domain
      197242-06.png
    6. test sending an email and see if the recipient can receive it

    This method doesn't require an existing mailbox in Office 365.
    If you would like to use an existing mailbox, you may need to use SMTP AUTH.


    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.

    2 people found this answer helpful.
    0 comments No comments

  2. Viktoria Gindosova 5 Reputation points
    2023-04-25T18:07:40.6266667+00:00

    Please, note, that IIS SMTP is not supported to relay emails to Exchange OnPrem and/or Office 365. Support will refuse to resolve cases related to this. https://learn.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-on-iis/configure-smtp-e-mail-in-iis-7-and-above

    1 person found this answer helpful.
    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.