HOWTO: Mantis 1.1.8 + PHPmailer

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
an3k
Posts: 4
Joined: 05 Feb 2010, 09:01

HOWTO: Mantis 1.1.8 + PHPmailer

Post by an3k »

This short guide describes how to get Mantis 1.1.8 with PHPmailer working on PHP5.

1. Delete class.phpmailer.php, class.smtp.php and the language directory in [MANTIS_HOME]/core/phpmailer/
2. Download latest PHPmailer version from http://phpmailer.worxware.com/index.php?pg=sf&p=dl. I used the PHP5/6 version but it should work with the PHP4 version too!
3. Extract the archive and open the created directory
4. Move class.phpmailer.php, class.smtp.php and the language directory into [MANTIS_HOME]/core/phpmailer/
5. Open [MANTIS_HOME]/core/email_api.php and comment out lines 807 to 813. After commenting out it will look like:

Code: Select all

#               if ( !is_null( $mail->smtp ) )  {
#                       # @@@ yarick123: It is said in phpMailer comments, that phpMailer::smtp has private access.
#                       # but there is no common method to reset PHPMailer object, so
#                       # I see the smallest evel - to initialize only one 'private'
#                       # field phpMailer::smtp in order to reuse smtp connection.
#                       $g_phpMailer_smtp = $mail->smtp;
#               }
6. Done

If you use a smtp server which only supports secured connections, do the following step:
7. Open [MANTIS_HOME]/core/phpmailer/class.phpmailer.php and set $SMTPSecure to 'tls' or 'ssl' - depending on what your smtp server accepts, ssl is more secure and preferred. Also, don't forget to set $g_smtp_host in [MANTIS_HOME]/config_inc.php to the correct host and port, eg. 'smtp.googlemail.com:465' (google apps).


To the developers: Do not include PHPmailer in Mantis - you see that it only creates problems! And you want to make more PHPmailer variables available in Mantis so we can use different settings for Mantis and for global usage. Currently, SMTPSecure is set to 'ssl' globally, thus i cannot use a unsecure server in a different "application" if it doesnt support the SMTPSecure setting (like Mantis).
Post Reply