HOME / COMMUNITY Switch to knowledge base

SMTP settings for Office 365

Hi Everyone, I struggled with this and couldn’t find much help here in the forum, so thought I’d share for anyone else having the same issue. @QF: perhaps you could verify and add to your documentation?

Before configuring Quickfile to send using O365, you must configure a user with:

  1. An O365 license (so that it has a mailbox)
  2. Permission to send on behalf of the desired From address
  3. Permission to use SMTP transport

For (1) the license, E1 or Business Basic is sufficient. For (2), go to the “From” mailbox in Exchange Admin Centre and give the account you’ll be authenticating with Send As permission.

For (3), you have to run some Powershell:

# specify domain and admin credential
$domain='yourdomain.co.uk'
$credential = Get-Credential


# Install Module and connect to ExchangeOnline
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -Credential $credential -ShowProgress $true


# Disable the global permission for SMTP authentiation (it's already disabled by default)
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
#Set-TransportConfig -SmtpClientAuthenticationDisabled $true
Set-TransportConfig -SmtpClientAuthenticationDisabled $false
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled


# Enable SMTP transport for the specific user
Get-CASMailbox -Identity relay.user@yourdomain.co.uk  | Format-List SmtpClientAuthenticationDisabled
# Set-CASMailbox -Identity relay.user@yourdomain.co.uk -SmtpClientAuthenticationDisabled $false
Set-CASMailbox -Identity relay.user@yourdomain.co.uk -SmtpClientAuthenticationDisabled $true
Get-CASMailbox -Identity relay.user@yourdomain.co.uk  | Format-List SmtpClientAuthenticationDisabled


# Test.  Note the above configuration might take a while to take effect (like an hour)
$RelayCredential = Get-Credential
$mailParams = @{
    smtpServer         = "smtp.office365.com"
    Port               = '587'
    UseSSL=$true
    Credential = $RelayCredential
    From = "support@yourdomain.co.uk"
    To="recipient@yourdomain.co.uk"
    Subject = "SMTP Relay"
    Body="Message SMTP Relay"
    DeliveryNotificationOption='onFailure','OnSuccess'
}
Send-MailMessage @mailParams

Finally, go configure SMTP settings in QF.

Hope this helps somebody!

Cheers

Rob

Hi @Rob_Phillips

Thank you for the information- I’m sure that other users will find this very helpful :slight_smile:

This topic was automatically closed after 7 days. New replies are no longer allowed.