I'm using Mantis for a while and suddenly (probably somebody updated something, but no one said anything) in my company it just stopped sending emails.
I'm about 2 weeks now searching what could have happened on our server, so I configured the enviroment on my own machine and the problem persists.
Yesterday could make it work, but I had to change mantis email_api.php, and so, that's why I'm asking if there's any other way to fix the problem without change this code (thinking about future compatibility changes, or system backup).
So, this is what i've done:
config_inc.php:
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = 'myemail@gmail.com';
$g_smtp_password = 'mypass';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_from_name = 'Mantis Bug Tracker';
$g_administrator_email = 'myemail@gmail.com';
$g_webmaster_email = 'myemail@gmail.com';
$g_return_path_email = 'myemail@gmail.com';
$g_from_email = 'myemail@gmail.com';
$g_validate_email = ON;
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT | LOG_FILTERING | LOG_AJAX;
$g_log_destination = 'file:C:\mantisbt.log';
--------
email_api.php
Added in function email_send( EmailData $p_email_data ):
Code: Select all
$t_mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
Windows server 2012;
MantisBT Version 1.3.1
PHP Version 5.6.18
Schema Version 209
ADOdb Version 5.20.4
Without this piece of code I got the following error:
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1.
OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I saw on github this pull-request which would create a configuration that could solve my problem, I think.
https://github.com/mantisbt/mantisbt/pull/1135