Configure email SMTP

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
fabio.abbiati
Posts: 2
Joined: 15 Jul 2015, 07:17

Configure email SMTP

Post by fabio.abbiati »

Mantis Version: 1.2.19
PHP Version: 5.6.0
Database: MS SQL 2008
OS: Windows Server 2008 R2

Dear All,

I have just finish to install and configure mantis (first use) on a server and seems that all functions works properly except the sending email function.
I changed the "config_inc.php" file like follow:

Code: Select all

$g_phpMailer_method        = PPHPMAILER_METHOD_SMTP;
$g_smtp_host               = 'xxx.xxx.xxx.xxx'; #IP address of the MS Exchange server
$g_smtp_username           = 'domain\username';
$g_smtp_password           = 'password';
$g_administrator_email     = 'username@domain.com';
$g_webmaster_email         = 'username@domain.com';
$g_from_email              = 'username@domain.com';
$g_return_path_email       = 'username@domain.com';
$g_from_name               = 'Mantis Bug Tracker';
$g_log_level               = LOG_EMAIL | LOG_EMAIL_REIPIENT | LOG_FILTERING | LOG_AJAX | LOG_DATABASE | LOG_LDAP;
$g_log_destination         = 'file:C:\mantisbt.log';
If I register a new user, I don't receive any email.
On the Exchange server the SMTP function is active because other programs uses it.

The log file show these messages:

Code: Select all

2015-07-15 09:08 CEST mail ERROR: Message could not be sent - Could not instantiate mail function.
2015-07-15 09:08 CEST mail ERROR: Message could not be sent - Invalid address: 
What it means?
Should I modify other configuration files in addition to "config_inc.php"?

I have already searched in internet and on the forum but I couldn't find the solution.
If you need more information to help me don't hesistate to ask,
Thank you very much for your help and support,
Fabio
newmantisuser
Posts: 68
Joined: 06 Aug 2012, 18:13

Re: Configure email SMTP

Post by newmantisuser »

Here is my working config_inc.php for mail. I had issues getting mail to our exchange server (hosted elsewhere) so I forked out 6 bucks a month for SMPT2GO.com mail service.

Try and simplify. Just go with what I have below and worry about logging etc later.

$g_phpMailer_method = 2;
$g_smtp_host = 'smtpcorp.com';
$g_smtp_port = '2525';
$g_smtp_username = 'xx@xxx.com';
$g_smtp_password = 'xxxxxxx';
$g_administrator_email = 'mantis@x.com';
$g_webmaster_email = 'mantis@x.com';
$g_from_email = 'mantis@x.com';
$g_return_path_email = 'mantis@x.com';

Not sure but this seems wrong also. An extra "P" perhaps?
$g_phpMailer_method = PPHPMAILER_METHOD_SMTP;

Pretty sure that log file "file" line is incorrect also.
fabio.abbiati
Posts: 2
Joined: 15 Jul 2015, 07:17

Re: Configure email SMTP

Post by fabio.abbiati »

Thanks for the reply, I have solved the problem


Now Mantis sends mail using internal Exchange 2003 server with the following configuration:
$g_phpMailer_method = 2;
$g_smtp_host = 'name of server';
$g_smtp_username = 'domain\user';
$g_smtp_password = 'password';
$g_administrator_email = 'mantis.maibox@domain.com';
$g_webmaster_email = 'mantis.maibox@domain.com';
$g_from_email = 'mantis.maibox@domain.com';
$g_return_path_email = 'mantis.maibox@domain.com';
$g_from_name = 'Mantis Bug Tracker';
Now I've disabled the writing of the log file but I confirm that the "file" string for the log works properly.
#$g_log_level = LOG_EMAIL | LOG_EMAIL_REIPIENT | LOG_FILTERING | LOG_AJAX | LOG_DATABASE | LOG_LDAP;
#$g_log_destination = 'file:C:\mantisbt.log';
Post Reply