Email not working on WAMP server

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
Testinguser
Posts: 1
Joined: 10 May 2012, 12:37

Email not working on WAMP server

Post by Testinguser »

Hello Guys,

I am stuck in one for problem with mantis. Please help me as early as possible. It's very critical to one of my project.

Techincal details are as follow:-

I am using following configuration in my system.
1) WAMP 2.2 Server
2) Mantis 1.2.8
3) Windows 2008 Server

Along with above, I have installed SMTP Server on windows.

When I tired to send mail from system using Java/PHP mailer, the mail is floating. But when trying with Manis application mails are floating i.e. on any change mails are recieved by user.

Also, I did the changes in only one file config_inc.php.

Below are the changes which I did in config_inc.php

<?php
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'SERVER NAME';
$g_smtp_username = 'abc@xyz.com';
$g_smtp_password = '';
$g_administrator_email = ''abc@xyz.com';
$g_webmaster_email = 'abc@xyz.com';
$g_from_name = 'Mantis Bug Tracker';
$g_from_email = 'abc@xyz.com';
$g_return_path_email = 'abc@xyz.com';
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;
$g_smtp_port = '25';
$g_smtp_connection_mode = 'ssl';
?>

When I checked in mantis_email_table in database. I got the enteries of events(triggers) which I did in mantis but emails were not reached to user. In table it shown me email has sent to all user which are present in mantis.

PLEASE HELP ME, IT'S VERY URGENT.

Please let me know where we need to changes to get emails. Also, let me know how can I check SMTP is configured correctly.
enzoweb
Posts: 8
Joined: 17 Feb 2012, 04:34

Re: Email not working on WAMP server

Post by enzoweb »

Not sure if this will help:

Can you send mail outside of Mantis from the server? ie is the mail working at all?

I had trouble because our internal mail was not set up correctly, so I resorted to using gmail. I first set up a gmail account called 'xxxissuestracker' (xxx is our company name).

I then put this in my congfig_inc.php file:

$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 = 'xxxissuestracker@gmail.com'; //replace it with your gmail address
$g_smtp_password = 'password'; //replace it with your gmail password

Make sure that in the "Manage" / "Manage Users" screen you have checked the right boxes for email notifications.

This works for me.
jefbro98
Posts: 3
Joined: 24 May 2012, 22:10

Re: Email not working on WAMP server

Post by jefbro98 »

I had a similar problem. I ended up removing all authorization and encryption parameters from the config file. It started working for me because the e-mail server was set up to accept anonymous connections.
Knowledge makes the world go 'round!
jshimota
Posts: 1
Joined: 20 Sep 2012, 21:04

Re: Email not working on WAMP server

Post by jshimota »

I have been trying for days to resolve mail troubles with a new install of mantis. the config is a Windows 2008 server, no IIS/SMTP, running WAMP 2.2.

the guts of my config_inc.php:

$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:e:\mantisbt.log';

$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_validate_email = ON;
$g_check_mx_record = OFF;
$g_allow_blank_email = OFF;
$g_limit_email_domain = OFF;
/* $g_phpMailer_method = 2; */
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_connection_mode = 'ssl';
$g_smtp_SMTPSecure = "ssl";
$g_SMTPAuth = true;
$g_smtp_port = 465 ;
$g_smtp_username = 'jshimota01@gmail.com'; //replace it with your gmail address
$g_smtp_password = 'xxxxxxxxxxxxxxx'; //replace it with your gmail password
$g_administrator_email = 'jshimota01@gmail.com'; //this will be your administrator email address
$g_return_path_email = 'jshimota01@gmail.com'; //this will be your administrator email address
$g_from_email = 'jshimota01@gmail.com'; //this will be your administrator email address
$g_email_send_using_cronjob = OFF;
$g_max_lost_password_in_progress_count = 5000;
$g_webmaster_email = 'jshimota01@gmail.com';
$g_email_receive_own = ON;
$g_debug_email = ON;

Additionally, I've tested Mail(), Sendmail() and SMTP methods in php and no problems. This test php file works flawlessly:
<?php
ini_set("include_path","e:/xampp/htdocs/mantis/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 = "jshimota01@gmail.com"; // GMAIL username
$mail->Password = "xxxxxxxxxxx";

$mail->From = "jshimota01@test.com";
$mail->FromName = "Bugtracker";
$mail->AddAddress("jshimota01@gmail.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 switched from a WAMP install (yes, OPENSSL module on, Apache SSL module on) to an XAMPP install - no change. same failure. I've tested with a local SMTP server, no joy either. I've turned off firewalls (of course not needed) and anything else I can think of. I get a 'message sent' when I reset a user password, but no diagnostics, no errors, no info to work with. The documentation of Mantis seems to be written years ago, when I go to MantisBT.org the date on the file is ancient. one discrepency is :

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_phpMailer_method = 2;

some notes show the numeric version, others say to use the text string.

Another discrepency is reference to 'ssl:smtp.gmail.com' vs. seperating the SSL to its own line.

finally, I've tried fake sendmail, tried to output using Sendmaltodisk (with Xampp) and get zero. I've tried setting to TLS and 587, nothing. Any ideas out there?
Jim Shimota
Coskun
Posts: 1
Joined: 20 Jan 2017, 10:21

Re: Email not working on WAMP server

Post by Coskun »

Hi,
I am new in mantis and I am not a php développer.
I tried to configure Mantis to send emails but even I tried many of configurations ( who works in a c# application), I couldn't send emails.
And for information, if you find emails in the mantis_email_table, it means that mantis can't send your emails. If an email is sent successfully, mantis will delete the line from the table.
But, it is not an error of mantis. The origine of the problem is phpmailer. In order to make phpmailer able to send emails I tried a lot of solution but no result!!
Windows blocks phpmailer. There is not a global solution which is valid for every system.

As a .NET developper, I found another solution.
I created a Windows service who checks the mantis_email_table every 5 minutes and if there are lignes in this table, it sends email and delete the associated line. For every sent mail, inserts logs to a logfile defined in the service.
It works perfectly for me.

At the end of all, Mantis is a very nice tool. Many thanks Mantis Team!
Post Reply