Solved

Azure SMTP configuration

  • 13 October 2020
  • 3 replies
  • 371 views

Userlevel 3
Badge +12

We have setup the SMTP on our Azure Acceptance env with all the required information, however we fail to send an email from our Azure AD user using the O365 smtp. 

O365 configuration:

SMTP Host: smtp.office365.com
SMTP Port: 587
SSL Protocol: OFF
TLS Protocol: ON

Indicium configuration with SSL ON:

 "Email": {
            "TwoFactorEmailMessageService": "TSFSmtpMessageService",
            "SmtpServer": "smtp.office365.com",
            "SmtpPort": 587,
            "UseSSL": true,
            "SmtpEnableSsl": "Yes",
            "SmtpUsername": "notificationsuat@hartmannship.onmicrosoft.com",
            "SmtpPassword": "*******",
            "SmtpFrom": "notificationsuat@hartmannship.onmicrosoft.com",
              "SmtpFromDisplayName": "UAT Notifications",
            "DefaultPasswordResetTemplate": {
                  "FromEmail": "notificationsuat@hartmannship.onmicrosoft.com",
                  "FromDisplay": "UAT Reset Password",
                  "Title": "Password reset token",
                  "Body": "Your password reset token is <b>{resetToken}</b>."
                }
        }

Error 1 with above config: 2020-10-13T06:54:08.4273543+00:00 0HM3EN17KKVMK:00000001 [ERR] System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [AM0PR02CA0002.eurprd02.prod.outlook.com] 

Indicium configuration with SSL OFF:

 "Email": {
            "TwoFactorEmailMessageService": "TSFSmtpMessageService",
            "SmtpServer": "smtp.office365.com",
            "SmtpPort": 587,
            "UseSSL": false,
            "SmtpEnableSsl": "No",
            "SmtpUsername": "notificationsuat@hartmannship.onmicrosoft.com",
            "SmtpPassword": "*******",
            "SmtpFrom": "notificationsuat@hartmannship.onmicrosoft.com",
              "SmtpFromDisplayName": "UAT Notifications",
            "DefaultPasswordResetTemplate": {
                  "FromEmail": "notificationsuat@hartmannship.onmicrosoft.com",
                  "FromDisplay": "UAT Reset Password",
                  "Title": "Password reset token",
                  "Body": "Your password reset token is <b>{resetToken}</b>."
                }
        }

Error 2 with above config: 2020-10-13T06:58:33.3732869+00:00 0HM3F8L7PVBFM:00000005 [ERR] System.Net.Mail.SmtpException: Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [AM6PR10CA0102.EURPRD10.PROD.OUTLOOK.COM]

 

Question: How do we configure the TLS if it is ON or OFF in the SMTP settings of Indicium? What are we missing ?

icon

Best answer by Jasper 13 October 2020, 14:33

View original

This topic has been closed for comments

3 replies

Userlevel 7
Badge +11

Hi mperrott, 

The problem here is probably that Azure blocks outbound email messages sent from any service in Azure that doesn’t use an authenticated SMTP relay service, to protect Azure data center IP addresses from reputation abuse.

The most common SMTP relay service that is integrated with Microsoft Azure is SendGrid, which is free for up to 25,000 emails per month. The SendGrid SMTP API allows you to send emails using the Thinkwise SMTP connector, but you could also use the Web API with the Thinkwise HTTP connector.

Instructions on how to setup SendGrid in Azure and send emails using SMTP can be found here and here, for example. Please consult the SendGrid documentation for more information. 

 

 

Userlevel 3
Badge +12

Thank you Jasper,

We have tested with SendGrid service and it is working as expected.

Userlevel 7
Badge +11

Great, thanks for the heads up!