Office365 email configuration

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
rmeske
Posts: 19
Joined: Feb 16, 2012 7:27 pm
Location: California
Contact:

Office365 email configuration

Post by rmeske » Dec 01, 2016 8:45 pm

Hello,

I was having problems with Mantis being able to send emails using an Office 365 account using SMTP whereas I had other online apps configured and sending emails successfully with the same account. The error being returned was:

Code: Select all

Detail: 5.7.60 SMTP; Client does not have permissions to send as this sender SMTP code: 550
In searching the forums I did not find anything useful so I went through the code I and found that Mantis also includes a reply to address when sending the email. This was the critical item causing the issue. Office 365 expects the from address, the reply to email and the username to all be the same email unless you have specifically allowed the user permissions to send as another email address.

Since I struggled getting Mantis to work with Office 365 I thought I would document the settings you need to make Office 365 work:

Code: Select all

$g_enable_email_notification = ON; #enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host 		= 'smtp.office365.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port 		= 587;
$g_smtp_username 	= 'youremail@yourdomain.com'; #replace with your email address used to log into Office 365
$g_smtp_password 	= '********'; #replace with your email password
$g_from_email		= 'youremail@yourdomain.com'; # Office 365 requires this to match the username email address
$g_return_path_email    = 'youremail@yourdomain.com'; # Office 365 requires this to match the username email address
Hope this proves to be helpful to others.

Ron

atrol
Site Admin
Posts: 7682
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Office365 email configuration

Post by atrol » Dec 06, 2016 4:16 am

Thanks for providing the information.

I recommend to follow the installation guide and to run admin/check/index.php after installation finished.
The script would have told you that there is something wrong with from_email and return_path_emai settings.
Please use Search before posting and read the Manual

sergio.roberto
Posts: 1
Joined: May 26, 2017 6:55 pm

Re: Office365 email configuration

Post by sergio.roberto » May 26, 2017 7:02 pm

I´m passing for the same problem.
It´s been impossible to reach the solution on the internet.
Anyone help?

Post Reply