How to make mantis 1.1.6 to work with Gmail?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
maxi_ng
Posts: 1
Joined: 25 Feb 2009, 04:30

How to make mantis 1.1.6 to work with Gmail?

Post by maxi_ng »

http://www.mantisbt.org/bugs/view.php?id=8369http://www.mantisbt.org/bugs/view.php?id=9908
I know that they fix it in 1.2.0a3. but I don't want to use a development version.
I have tried their approach with no luck.
I have tested my xampp 1.7.0 ssl, it is working alright.

So how to make mantis 1.1.6 work with Gmail smtp?
sigmapie
Posts: 6
Joined: 08 Oct 2008, 20:14

Re: How to make mantis 1.1.6 to work with Gmail?

Post by sigmapie »

I answered that question here, good luck.
http://www.mantisbt.org/forums/viewtopic.php?t=6131
luke.nelson
Posts: 1
Joined: 02 Apr 2009, 20:13

Re: How to make mantis 1.1.6 to work with Gmail?

Post by luke.nelson »

These are some slightly different steps that I've documented for my own purposes. I hope this works for you.

To use GMail as an SMTP server, you have to hack Mantis 1.1.6 to use SSL. Here are the steps.
1) Install Mantis 1.1.6 per the instructions. By default, everything should work except for e-mail.
2) If you don't already have one, create a gmail account, and under the account settings, enable POP access.
3) Get a recent version of phpMailer that is able to handle the "ssl://" prefix on host names (I use Version 2.3). Rename the existing phpmail folder in the mantis installation (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mantis\core\phpmailer). Copy the new phpmail mailer package into the core folder.
4) Hack the phpmailer class (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mantis\core\phpmailer\class.phpmailer.php) so that the $smtp variable is declared public, not private.
5) Place the following entries in the config_inc.php file:
#--- SMTP Settings -----
$g_phpMailer_method = 2;
$g_smtp_host = "ssl://smtp.gmail.com:465";
$g_smtp_username = "<yourname>@gmail.com";
$g_smtp_password = "<yourpassword>";

This hack is not necessary for Mantis 1.2 and higher, but as of this writing, Mantis 1.2 is still an unreleased version.

The hack on the phpmailer class is necessary because the ./core/email_api.php accesses this variable in an attempt to cache the connection. I assume this too was fixed in 1.2 and higher.
Post Reply