Hey guys, in this post will learn about email configuration in MantisBT.
Email Configuration is required to,
- Reset Password
- Confirm User Registration
- Notifications
If the Email is not configured,
- Users can’t receive any confirmation to register the account.
- Users can’t reset their password
- Users don’t receive any notifications about the issues
In order to overcome these, we have to configure email in MantisBT, so that the system can send emails to the user to fulfill their needs.
Letz see how to configure
Step 1 : Navigate to config_inc.php file
Step 2: Edit the config_inc.php file add below lines of code
$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_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = ‘file:C:\mantisbt.log’;
Note: If your using gmail make sure allow less secure apps option turned on the gmail account that you are using to send emails.
Step 3: After adding the code, the file looks like below.
Step 4: Save the file
Click Invite Users and add all the required details to create a user in MantisBT.
Next page, Click Reset Password to send confirmation URL via E-mail.
Note: If you have not configured email, the invited user will not receive any email from the MantisBT system:)
Check the created user’s email, he would have received account registration link
By clicking the link, the user can confirm registration and set his own access password to access the assigned projects.
Note: Only administrator can perform all available functions like Manage users, Manage projects etc.,
Let me know how your configuration goes in the comments section below.
Suggested Readings:
Top 30 Cucumber Interview Questions & Answers
Steps to automate two-factor authentication (2FA) using selenium
Top 40 Selenium Interview Questions & Answers
Know anyone who would like to learn MantisBT? Let them know by sharing this article on Facebook, Twitter, Pinterest or Google Plus.
Hi Shobika,
Thank you for the amazing post,
I ve tried to configure email for our company mantis bug tracker but I m unable to get emails. I ve done the same exact setup, what could be the issue, Where do I specify the email subject and body and all?
Hi Manoujitha,
Am glad that you found the post useful.Did you try creating an user after configuring the email file? Email subject and body is automatically created by Mantis.
Hi Shobika,
Yes I did, but the emails weren’t sent.
Did you check the log file? Are you using Gmail SMTP server?
No I did not check the log file, I m not sure how I can do that. Yes i m using a gmail SMTP server.
If you have used my code then the log destination is the path that you have mentioned in $g_log_destination = ‘file:C:\mantisbt.log’; In this case its in C drive and the file name is mantisbt.log
If you are using gmail SMTP server, make sure ‘Allow access to less secure apps’ option is turned on. This setting you will find under your gmail – my account>sign-in & security and scroll to the bottom to see that option and turn it on.
Hi Shobika,
I have done installing MantisBT successfully through your blog. Very much thankful to that. Now I want to configure the mail id. We are using the outlook here and mine is gmail account. After copy and pasting your details in config_inc.php what and all should be changed. I tried to open your file but it showing some error. Kindly show me what to be changed. This will be helpful for me.
@Prasanna, am glad you found it useful. Fixed the issue with the file as well.
hello Shobika i installed Mantis V 2.15 successfully through your blog but when i want to configure the mail, after copy and pasting your lines of codes in my config_inc but i don’t receive any mail when of confirmation when i create a new user.
Can you help me to solve this probleme thank you
Hello,
If your using gmail make sure allow less secure apps option turned on the gmail account that you are using to send emails.
Thanks,
Shoby
Hey,
I Install succesfully mantis trough your blog but when i want configure email with the server ‘smtp.gmail.com’ copy cat the same lines of code but i don’t receive emails.
Can you help me to solve this problem Its urgent ‘I must install mantis in the server of my company) thank you
Hello Youssefi,
If your using gmail make sure allow less secure apps option turned on the gmail account that you are using to send emails.
Thanks,
Shoby
Thank you, Shobika!
After several instructions, I found your tutorial and now it works.
Thank you:)
Hi Shobika,
I have installed mantisbt using xampp server, following are the versions.
mantisbt – 2.24.3
PHP – 7.4.12
Database driver – mysqli
Database Version, Description – 10.4.16, 10.4.16-MariaDB
And i have configured SMTP settings with gmail in config file, also turned on less secure apps in gmail. But still i didn’t get email notification.
Kindly suggest the solution
Hello Poorna,
Try creating a user after configuring the email to trigger notifications! Also, please don’t forget to check the log file, If you have used my code then the log destination is the path that you have mentioned in $g_log_destination = ‘file:C:\mantisbt.log’; In this case its in C drive and the file name is mantisbt.log.