How Install MantisBT with Email Notfication Worked

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

Dear All,

I am beginner install Mantisbt, couple time i tried installing mantisbt.
But for email notification still failed.
Many version of mantisbt (2.4 , 2.0 ,1.2) i have been tried but is same result.

Anyone on this forum have succesfully installing with email notification worked ?

Please give any suggestion ?

Thans a lot. :)
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

Tried send reset password user, then chheck log from mantisbt application.

"
2017-05-04 10:37 CEST MAIL email_api.php:1385 email_send() ERROR: Message could not be sent - Invalid address: (punyEncode) project-noreply@@xxxxx.com

"

Config_inc.php :

# --- Email Configuration ---
$g_phpMailer_method = PHPMAILER_METHOD_SMTP; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host = '192.168.11.241'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_username = 'helpdesk'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_password = 'xxxx'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;
$g_webmaster_email = 'some.one@xxxxx.com';
$g_from_email = 'project-noreply@xxxxx.com'; # the "From: " field in emails
$g_return_path_email = 'some.one@xxxxx.com'; # the return address for bounced mail
# $g_from_name = 'Mantis UAT Tracker';
# $g_email_receive_own = OFF;
# $g_email_send_using_cronjob = OFF;
$g_log_level = LOG_EMAIL | LOG_EMAIL_REIPIENT ;
$g_log_destination = 'file:\var\www\project\mantisbt.log';
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

I have been tried with OS windows with XAMPP and also Linux Ubuntu, But same result ..

Any one have trick on this ? :idea:

Thanks a lot
mcmo
Posts: 11
Joined: 18 Oct 2016, 07:04

Re: How Install MantisBT with Email Notfication Worked

Post by mcmo »

Have you googled the error message?
I found this
http://stackoverflow.com/questions/3855 ... figuration
Hope this helps.
Marc
--------------------------------
Mantis: 2.1.0
PHP: 5.5.9
SQL: MySQL 5.7.16
OS: Ubuntu Linux 14.04.3
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

mcmo wrote:Have you googled the error message?
I found this
http://stackoverflow.com/questions/3855 ... figuration
Hope this helps.

Thanks mcmo for your replay, actually i am not expert on php.
Probably any other easy way to solve di this problem..

Any other advice.. welcome..

:idea:
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

tray using phpmailer class .

<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
*/

//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Asia/Jakarta');

require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;

//Tell PHPMailer to use SMTP
$mail->isSMTP();

//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;

//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';

//Set the hostname of the mail server
$mail->Host = 'xxxxxxxx';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6

//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 465;

//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'ssl';


//Whether to use SMTP authentication
$mail->SMTPAuth = true;


//Custom connection options
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
));



//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "xxxx";

//Password to use for SMTP authentication
$mail->Password = "@xxxx";

//Set who the message is to be sent from
$mail->setFrom('xxxxx@gmail.com', 'First Last');

//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');

//Set who the message is to be sent to
$mail->addAddress('xxxxx@gmail', 'John Doe');

//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';

//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));

//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';

//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

Is succeed email !!

But using :

$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
));

For skip auth on.

But how to add on mantisbt ?
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

try with other method using SENDMAIL.

<?php
/**
* This example shows sending a message using a local sendmail binary.
*/

require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;
// Set PHPMailer to use the sendmail transport
$mail->isSendmail();
//Set who the message is to be sent from
$mail->setFrom('admin@xxxxxx', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@xxxxxx', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('swdf@xxxxxx', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer sendmail test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

With this script email succeed sent, but still bad luck if using in mantisbt.

Using Linux postfix ssmtp : http://www.codingalpha.com/send-email-i ... -function/
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

foxwestjava wrote:try with other method using SENDMAIL.

<?php
/**
* This example shows sending a message using a local sendmail binary.
*/

require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;
// Set PHPMailer to use the sendmail transport
$mail->isSendmail();
//Set who the message is to be sent from
$mail->setFrom('admin@xxxxxx', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@xxxxxx', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('swdf@xxxxxx', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer sendmail test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

With this script email succeed sent, but still bad luck if using in mantisbt.

Using Linux postfix ssmtp : http://www.codingalpha.com/send-email-i ... -function/

# --- Email Configuration ---
$g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_webmaster_email = 'xxxx@xxx';
$g_from_email = 'noreply@xx'; # the "From: " field in emails
$g_return_path_email = 'xxx@xxxx'; # the return address for bounced mail
$g_from_name = 'xxx UAT Tracker';
# $g_email_receive_own = OFF;
# $g_email_send_using_cronjob = OFF;
$g_enable_email_notification = ON; //enables the email messages
$g_log_level = LOG_NONE;
$g_log_destination = 'file:/var/www/log/mantisbt.log';
$g_debug_email = OFF;

Download the lastest version 2.5, install again..

It worked now can notif email and succed ... :wink:
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

Try with Zimbra Mail Server .
Install with MantusBT 2.5

Config Email :

# --- Email Configuration ---
$g_phpMailer_method = PHPMAILER_METHOD_SMTP; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host = 'xxxxxxxxxxx'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_username = 'xxxx'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_password = 'xxxx'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_webmaster_email = 'xxxx@xxx';
$g_from_email = 'noreply@xx'; # the "From: " field in emails
$g_return_path_email = 'xxx@xxxx'; # the return address for bounced mail
$g_from_name = 'xxx UAT Tracker';
# $g_email_receive_own = OFF;
# $g_email_send_using_cronjob = OFF;
$g_enable_email_notification = ON; //enables the email messages
$g_log_level = LOG_NONE;
$g_log_destination = 'file:/var/www/log/mantisbt.log';
$g_debug_email = OFF;

This also worked send email too.. :)
foxwestjava
Posts: 9
Joined: 05 May 2017, 02:30

Re: How Install MantisBT with Email Notfication Worked

Post by foxwestjava »

Don't forget after installation, check your setting on http://..www/admin/check

This link check very usefully help to check installation and check your setting config_inc.php

:D
Attachments
mantis.jpg
mantis.jpg (57.11 KiB) Viewed 15736 times
Post Reply