Configure SMTP with Office365 account

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
GoodFeel
Posts: 8
Joined: Jun 18, 2019 5:35 am

Configure SMTP with Office365 account

Post by GoodFeel »

Hello,

I try to set up the SMTP configuration on my Mantis tenant.

I don't found a lot information about this topic but I configured like this :

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
After that, I try to create a bug to send a mail notification but it doesn't work. I check the mantis logs :

Code: Select all

2020-01-20 11:15 CET MAIL email_api.php:1410 email_send() ERROR: Message could not be sent - SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:0A00AB80, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:3A280000, 1.36674:0E000000, 1.61250:00000000, 1.45378:3F280000, 1.44866:6C020000, 16.55847:6B120000, 17.43559:0000000004020000000000000000000000000000, 20.52176:140F548A1A00101043050000, 20.50032:140F548A8A17000000000000, 0.35180:48050000, 255.23226:0A00 SMTP code: 554 Additional SMTP info: 5.2.0
I don't found any official document about this configuration, only some topics on forums.

Can you please help me ?

Thanks a lot.

GoodFeel
Posts: 8
Joined: Jun 18, 2019 5:35 am

Re: Configure SMTP with Office365 account

Post by GoodFeel »

Nobody try to set up an O365 SMTP ?

Thanks.

GoodFeel
Posts: 8
Joined: Jun 18, 2019 5:35 am

Re: Configure SMTP with Office365 account

Post by GoodFeel »

Finally, it's works with this syntax :

Code: Select all

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.office365.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = '587';
$g_smtp_username = 'xxxx@domain';
$g_smtp_password = "password";
$g_return_path_email   = 'xxxx@domain';
$g_administrator_email='xxxx@domain';
$g_webmaster_email=$g_administrator_email;
$g_from_email='xxxx@domain';
Thanks.

mushu
Posts: 160
Joined: Jan 04, 2017 12:41 pm

Re: Configure SMTP with Office365 account

Post by mushu »

Thank you for posting the solution. We are going to be moving to O365 soon and this will help me configure our Mantis also.

Post Reply