[ACCEPTED]-Configuring MantisBT to send emails using GMail-bug-tracker

Accepted answer
Score: 32

According to a posting on the MantisBT forums, these are working settings 1 for GMail:

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = 'username@gmail.com';
$g_smtp_password = 'yourpassword';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;
Score: 3

Something to add about GMail. These settings 19 are correct but GMail has instituted some 18 new security that will still prevent email 17 from being sent from Mantis or any other 16 mailer using the SMTP connector.

In order 15 to do this with GMail, you must "Allow less secure apps to access accounts". In GMail 14 admin, there is a setting to allow users 13 to control access from "less secure 12 apps," which must be turned on, and 11 then the user account used to send mail 10 must turn on access from "less secure 9 apps." The link above provides the 8 information on how to configure this.

The 7 frustrating thing is everything will appear 6 to work fine but no emails are sent. There 5 is no error indication from the SMTP server. However, the 4 user account used to send mail may receive 3 an email from GMail indicating someone is 2 trying to access the account. I spent hours 1 trying to track this down.

Score: 3

If anyone still faces issue or error while 4 configuration add log level so that you 3 can drill down the problem further. Below 2 settings worked for me. Detailed explanation 1 is written here

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = '465';
$g_smtp_connection_mode = 'ssl';
$g_smtp_username = 'letzdotesting@gmail.com';
$g_smtp_password = 'xxxxx';
$g_administrator_email = 'letzdotesting@gmail.com';
$g_webmaster_email = 'letzdotesting@gmail.com';
$g_from_email = 'letzdotesting@gmail.com';
$g_return_path_email = 'letzdotesting@gmail.com';
$g_default_timezone = 'UTC';
$g_log_destination = 'file:C:\mantisbt.log';
Score: 2
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username        = 'username';   // without @gmail.com
$g_smtp_password        = 'password';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;

it Works for me


Score: 1

2017 update (MantisBT 2.3.0) Please follow the steps below:


Access the docker instance running the command 9 below:

docker exec -it {docker-id} bash


if you dont have any editor:

# sudo apt-get update
# apt-get install vim

create 8 a log file:

# touch /var/log/mantisbt.log
# cd /var/log/
# chmod 777 mantisbt.log


# vim /var/www/html/config/config_inc.php

add the following content to 7 the file opened in the earlier step:

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_administrator_email = 'your-admin-email@gmail.com';
$g_webmaster_email = 'your-webmaster-email@gmail.com';
$g_return_path_email = 'your-return-email@gmail.com';
$g_from_email = 'your-from-email@gmail.com';

$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = 465;
$g_smtp_connection_mode = 'ssl';
$g_smtp_username = 'username';
$g_smtp_password = 'password';

$g_log_destination = 'file:/var/log/mantisbt.log';

$g_validate_email = OFF;


You 6 need to do this in order to allow MantisBT 5 authentication:

  1. Access the following URL:


  2. Navigate 4 to the Sign-in & Security menu-item 3 under menu-tree.

  3. Check the "Allow less secure apps" option 2 and set equals to true

Image: enter image description here]

You're good 1 to go! Tested and running with these configurations. =]

Score: 0

My issue was solved by updating ca certificates. I 14 am using Xampp, with PHP 7.2 on Windows 13 sever 2012.

Although the below link provides 12 you with the details, I mention the relavent 11 part too:

Updating CA certificates

Updating CA certificates To update 10 your CA certificates, make sure your operating 9 system is fully up to date - CA certs are 8 usually updated via OS updates. Alternatively, you 7 can download the latest CA cert file from curl, install 6 it somewhere accessible (for example /etc/ssl/cacert.pem) and 5 point at it from the openssl.cafile and curl.cainfo 4 directives in your php.ini file (this location 3 will vary according to your OS and PHP 2 config; where you need to put it is beyond 1 the scope of PHPMailer!):

openssl.cafile = /etc/ssl/cacert.pem 
curl.cainfo = /etc/ssl/cacert.pem


More Related questions