Configuring SSRS Email with Office 365: Troubleshooting Required

I’ve hit a snag while setting up email for SQL Server Reporting Services (SSRS) with Office 365. Here’s the deal:

The PowerShell test works fine. I used this script:

$creds = New-Object PSCredential 'myemail@company.com', (Get-Content 'C:\secret.txt' | ConvertTo-SecureString)

$mailParams = @{ 
  SmtpServer = 'smtp.office365.com'
  Port = 587
  UseSsl = $true
  Credential = $creds
  From = 'myemail@company.com'
  To = 'recipient@example.com'
  Subject = 'Test Email'
  Body = 'SMTP test from Office 365'
}

Send-MailMessage @mailParams

This works great, so I know my O365 setup and network are okay.

But SSRS won’t send emails. I’ve tried different settings in the rsreportserver.config file, like:

<RSEmailDPConfiguration>
  <SMTPServer>smtp.office365.com</SMTPServer>
  <SMTPServerPort>587</SMTPServerPort>
  <SMTPAccountName>myemail@company.com</SMTPAccountName>
  <SMTPUseSSL>True</SMTPUseSSL>
  <SendUsing>2</SendUsing>
  <SMTPAuthenticate>1</SMTPAuthenticate>
  <SendUserName>[encrypted]</SendUserName>
  <SendPassword>[encrypted]</SendPassword>
  <From>myemail@company.com</From>
</RSEmailDPConfiguration>

SSRS keeps giving me this error: ‘Failure sending mail: At least one error has occurred. Mail will not be resent.’

Any ideas what I’m missing here? The PowerShell test works, but SSRS won’t play ball. Help!

hey there! have u tried using port 25 instead of 587? sometimes office365 can be picky bout that. also, make sure ur SSRS service account has the proper exchange online permissions. if all else fails, u might wanna setup a relay server to handle the email sending. good luck!

I encountered a similar issue when configuring SSRS with Office 365. One crucial step that’s often overlooked is enabling SMTP AUTH for your Office 365 account. This can be done through the Exchange Admin Center. Additionally, ensure that your SSRS service account has the ‘Send As’ permission for the email address you’re using. If these don’t resolve the issue, consider implementing Modern Authentication (OAuth) for SSRS, which is more secure and reliable than basic authentication. Lastly, verify that your firewall isn’t blocking outbound SMTP traffic on the specified port.

hmm, interesting issue! have u tried checking the SSRS logs for more detailed error messages? sometimes they can give clues about whats going wrong. also, maybe double-check ur encryption settings for the password in the config file? oh, and does ur SSRS service account have the right permissions to send emails thru O365? just some thoughts to explore!