Office 365 smtp mail relay

Office 365 provides a built-in SMTP mail relay service that allows you to send emails from your application or service using your Office 365 credentials. Here's a step-by-step guide to set up an SMTP mail relay in Office 365:

Prerequisites:

  1. You have an Office 365 account with a valid username and password.
  2. You have a domain registered with Office 365 (e.g., contoso.com).
  3. You have a valid SSL/TLS certificate (optional but recommended).

Step 1: Enable SMTP Relay

  1. Log in to the Office 365 admin center (https://admin.microsoft.com).
  2. Go to Settings > Services & add-ins > Connectors.
  3. Click on Microsoft 365 > SMTP relay.
  4. Toggle the switch to On to enable SMTP relay.

Step 2: Configure SMTP Relay Settings

  1. In the SMTP relay page, click on Configure.
  2. Enter the following settings:
    • Server name: smtp.office365.com (or smtp.office365.com:587 if you want to use port 587).
    • Port: 587 (or 25 if you want to use port 25).
    • Authentication: Select Username and password.
    • Username: Your Office 365 username (e.g., [email protected]).
    • Password: Your Office 365 password.
    • Encryption: Select TLS (or SSL if you prefer).
  3. Click Save to save the changes.

Step 3: Configure Your Application or Service

  1. In your application or service, configure the SMTP settings to use the Office 365 SMTP relay:
    • Server: smtp.office365.com (or smtp.office365.com:587 if you're using port 587).
    • Port: 587 (or 25 if you're using port 25).
    • Authentication: Use the same username and password you entered in Step 2.
    • Encryption: Use TLS (or SSL if you prefer).

Tips and Considerations:

By following these steps, you should be able to set up an SMTP mail relay in Office 365 and send emails from your application or service using your Office 365 credentials.