Mantisbt not sending emails

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
benitocam2
Posts: 1
Joined: 08 Oct 2014, 14:05

Mantisbt not sending emails

Post by benitocam2 »

Hello,

I have a Windows Server 2008 R2 with XAMPP. There is a something strange, as the Mantis does not try to send any mail. I inspect the network traffic with a traffic capturer but there is nothing. NO connection is established from the mantis server.

I have configured the config_inc.php following this link http://www.mantisbt.org/forums/viewtopi ... =3&t=15398, and this is the resulting file:

<?php
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'mantisbt';
$g_db_username = 'xxxxxx';
$g_db_password = '';
$g_default_language= 'spanish';
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;

$g_allow_signup = ON; //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587 ;
$g_smtp_username = 'benitocam2@gmail.com'; //replace it with your gmail address
$g_smtp_password = 'xxxxxxxxxxx'; //replace it with your gmail password
$g_administrator_email = 'benitocam2@gmail.com'; //this will be your administrator email address
$g_return_path_email = 'benitocam2@gmail.com'; //this will be your administrator email address
$g_from_email = 'benitocam2@gmail.com'; //this will be your administrator email address
$g_email_send_using_cronjob = OFF;
$g_webmaster_email = 'benitocam2@gmail.com';

?>

There is no antivirus and firewalls are disabled, so this is not the problem.

I have tried with this testing script and with it the messages are sent correctly:

<?php
ini_set("include_path","c:/xampp/htdocs/mantisbt/library/phpmailer/");

require("class.phpmailer.php");

$mail = new PHPMailer();


$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = "benitocam2@gmail.com"; // GMAIL username
$mail->Password = "xxxxxxxx";

$mail->From = "benitocam2@gmail.com";
$mail->FromName = "Bugtracker";
$mail->AddAddress("mantisbt@emergenciasgc.com");


$mail->Subject = "PHPMailer Test Message";
$mail->Body = "Hi! \n\n This is a test e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}
?>

I do not know where is the problem. Any clues?
Post Reply