I'm having trouble setting up SMTP using Office 365?

Viewed 810

I've been asked to set up SMTP using office 365. I've created a generic email account, given it a licence for exchange. I've enabled "Authenticated SMTP" in the user settings as well.

I've sent over:

E-Mail Address
SMTP Host: SMTP.Office365.com
SMTP Port: 587
SMTP Username: which is the email address
SMTP Password:

I've tested it on smtper.net and I keep getting:

"SMTP send error. The operation has timed out."

If I untick "Use Secured Connection", then I get an error message:

"SMTP send error
Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail \[YT3PR01CA0019.CANPRD01.PROD.OUTLOOK.COM\]"

I'm sure I'm either missing something or I've not done something correctly.

This is the information I was sent from the original email:

\*\*SMTP Email Account Information

We would like to set up your email account details so that you are ready to go with our email notifications. Please can you set up a generic email account (e.g. portal@partner.co.uk) that we can use to enter the details into our system? We will need the following information:

Email Address
SMTP Host
SMTP Port
SMTP Username
SMTP Password\*\*

E-Mail Address
SMTP Host: SMTP.Office365.com
SMTP Port: 587
SMTP Username: which is the email address
SMTP Password:
1 Answers

You could narrow down the issue to find whether the issue is with the MS end or your application end. Let's try to send an email via PowerShell. Here are the steps and commands.

Step 1: Connect with Microsoft Exchange

  • Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
  • Import-Module ExchangeOnlineManagement
  • Connect-ExchangeOnline -UserPrincipalName 'admin email'

Step 2: Send test email

  • $cred = Get-Credential –UserName 'which is the email address'
  • Send-MailMessage -To "Any email address" -From "which is the email address" -Subject "Test Email" -BodyAsHtml "Successfull !!" -SmtpServer "smtp.office365.com" -Port 587 -Credential $cred –UseSsl

Step 1 will download the Exchange module and connect you with the Exchange admin

Reference MS docs Send-MailMessage , Connect to Exchange Online PowerShell

If it is not successful please contact Microsoft to check your Tenant authentication status.

Related