[SOLVED] Email Not sending to users when pass reset.

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

raghava
TestLink user
Posts: 2
Joined: Thu Mar 26, 2009 7:23 am

[SOLVED] Email Not sending to users when pass reset.

Post by raghava »

Hi,

I installed TestLink 1.8.0 in XAMPP server, i confiured SMTP in server, in config.inc.php as below

Code: Select all

 [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
// 
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host        = '[smtp.peoplecorp.com]';  # SMTP server MUST BE configured  


$g_tl_admin_email     = '[raghav.swami@peoplecorp.com]'; # for problem/error notification 
$g_from_email         = '[raghav.swami@peoplecorp.com]';  # email sender
$g_return_path_email  = '[raghav.swami@peoplecorp.com]';
$g_smtp_host = '[smtp.peoplecorp.com]';
#$g_smtp_host = '10.20.30.40';



# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;   

# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;

// Configure only if SMTP server requires authentication
$g_smtp_username    = 'raghav.pattaswami';  # user  
$g_smtp_password    = 'swami1';  # password 

but when I reset the users password I getting the error 
"  The following From address failed: [raghav.swami@peoplecorp.com]  "
Please help any body how to fix this problem.

Thanks
Raghav
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Post by TurboPT »

I think you simply need to remove the [ and ] characters from the settings.
GetWorked
TestLink user
Posts: 2
Joined: Wed Oct 07, 2009 1:03 am

Post by GetWorked »

I'm having a similar TestLink problem with outbound emails when I reset a user password. Has anyone tried to use Gmail as the SMTP server? It's using SSL (port 465) and I can't see where to define the port number.

I've tried

$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = '465';

and

$g_smtp_host = 'smtp.gmail.com:465';

Neither seem to work. The error message I'm getting is:

"The following From address failed: address@gmail.com"

The email account is setup for POP/SMTP, and is currently working with an SMTP client, i.e. Mantis currently uses this same account.

Any help would be appreciated.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Post by TurboPT »

Google also says ports 465 (which you've tried) or 587.

Does 587 work? Other than that, we would need to investigate more.
GetWorked
TestLink user
Posts: 2
Joined: Wed Oct 07, 2009 1:03 am

Post by GetWorked »

Here is the mail section of the config.inc.php file:

$g_smtp_host = 'smtp.gmail.com:587';
$g_from_email = 'noreply@safedrivingsystems.com';
$g_return_path_email = 'noreply@safedrivingsystems.com';
$g_mail_priority = 5;
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;
$g_smtp_username = 'noreply@safedrivingsystems.com';
$g_smtp_password = 'MyPassword';

I've tried both ports, 465 and 587, on the same line as the $g_smtp_host and on a separate line ($g_smtp_port). Neither seem to work, though they are the same as my Mantis settings. I thought I saw somewhere else that the From email address has a length limitation of 30 characters. I'm obviously right on the edge with these email addresses.

Any ideas would be helpful. Even just a confirmation that TestLink does work with Google-hosted email.
Alex.G
TestLink user
Posts: 3
Joined: Fri Feb 19, 2010 9:13 am

Re: Email Not sending to users when pass reset.

Post by Alex.G »

raghava wrote:Hi,

I installed TestLink 1.8.0 in XAMPP server, i confiured SMTP in server, in config.inc.php as below

Code: Select all

 [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
// 
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host        = '[smtp.peoplecorp.com]';  # SMTP server MUST BE configured  


$g_tl_admin_email     = '[raghav.swami@peoplecorp.com]'; # for problem/error notification 
$g_from_email         = '[raghav.swami@peoplecorp.com]';  # email sender
$g_return_path_email  = '[raghav.swami@peoplecorp.com]';
$g_smtp_host = '[smtp.peoplecorp.com]';
#$g_smtp_host = '10.20.30.40';



# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;   

# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;

// Configure only if SMTP server requires authentication
$g_smtp_username    = 'raghav.pattaswami';  # user  
$g_smtp_password    = 'swami1';  # password 

but when I reset the users password I getting the error 
"  The following From address failed: [raghav.swami@peoplecorp.com]  "
Please help any body how to fix this problem.

Thanks
Raghav
remove [] and it will work
example:

Code: Select all

$g_smtp_host        = '[smtp.peoplecorp.com]';  # SMTP server MUST BE configured 


$g_tl_admin_email     = 'raghav.swami@peoplecorp.com'; # for problem/error notification
$g_from_email         = 'raghav.swami@peoplecorp.com';  # email sender
$g_return_path_email  = 'raghav.swami@peoplecorp.com';
$g_smtp_host = 'smtp.peoplecorp.com'; 
andrelgribeiro
TestLink user
Posts: 1
Joined: Wed Mar 03, 2010 9:07 pm

Same problem

Post by andrelgribeiro »

Hello all,
I ve got the same problem with account gmail (tls-port 587,465).
ex.

$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = 587;
$g_tl_admin_email = 'xxxx@gmail.com'; # for problem/error notification
$g_from_email = 'xxxx@gmail.com'; # email sender
$g_return_path_email = 'xxxxx@gmail.com';
# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 1;
# Taken from mantis for phpmailer config
#define ("SMTP_SEND",2);
$g_phpMailer_method = 2;
$g_smtp_username = 'xxxxxxx@gmail.com'; # user
$g_smtp_password = 'xxxxxxx'; # password

Please, somebody help us?

Tks
mbrugger
TestLink user
Posts: 1
Joined: Wed Jul 28, 2010 11:09 am

Re: Email Not sending to users when pass reset.

Post by mbrugger »

I fixed the problem for me but it is a little tricky

1. you need a more recent PHPMailer Version (I used 1.8.1) which supports ssl mail sending
download, unzip PHPMailer from sourceforge
replace third_party/phpmailer in your testlink folder with PHPMailer-ML_v1.8.1_core/_acp-ml/modules/phpmailer from the PHPMailer archive

2. you need to activate ssl in lib/functions/email_api.php
add the following code:

Code: Select all

 case 2: $mail->IsSMTP();
                                {
                                        # SMTP collection is always kept alive
                                        #
                                        $mail->SMTPKeepAlive = true;
                                        # @@@ 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.
                                        $mail->SMTPSecure = 'ssl';
                                        if( is_null( $g_phpMailer_smtp ) )  {
                                                register_shutdown_function( 'email_smtp_close' );
                                        } else {
                                                $mail->smtp = $g_phpMailer_smtp;
                                        }
                                }
                                break;

this was my quick hack, a nice solution should be made configurable
mahawolf
TestLink user
Posts: 1
Joined: Fri Oct 08, 2010 8:57 am

Re: Email Not sending to users when pass reset.

Post by mahawolf »

Additionally, I changed some code and succeeded.

<deleted code>
$g_smtp_port = 587;

<fixed code>
"$g_smtp_host = 'smtp.gmail.com';" -> "$g_smtp_host = 'smtp.gmail.com:465'; #(or 587)"
barrangatan
TestLink user
Posts: 1
Joined: Fri Dec 31, 2010 3:02 am

Re: Email Not sending to users when pass reset.

Post by barrangatan »

Thanks for the solution. I was able to get email working also on version 1.9 and my Gmail account after upgrading phpmailer.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: [SOLVED] Email Not sending to users when pass reset.

Post by fman »

TL 2.0 will use new PHPMailer (version 5.1) and support new config parameters.
We are going to see if we can also include this update on next fix for 1.9.0 (1.9.1)
Fosco
TestLink user
Posts: 4
Joined: Thu Dec 30, 2010 1:11 pm

Re: [SOLVED] Email Not sending to users when pass reset.

Post by Fosco »

I was update the PHPMailer from my Apache server and now when I try to change the user's password appear the following message "Password Reset can not be done. Reason: SMTP Hostname seems to be invalid"
I use the port 587 with user autentication, but without SSL support.
The SMTP section from my config_inc.php is:

Code: Select all

/* [SMTP] */

$g_smtp_host        = 'smtp.mailserver.com.br:587';  # SMTP server MUST BE configured

# Configure using custom_config.inc.php
$g_tl_admin_email     = 'mail@mailsever.com.br'; # for problem/error notification
$g_from_email         = 'mail@mailserver.com.br';  # email sender
$g_return_path_email  = 'mail@mailserver.com.br';

/** Configure only if SMTP server requires authentication */
$g_smtp_username    = 'mail@mailserver.com.br';  # user
$g_smtp_password    = 'password';  # password

fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: [SOLVED] Email Not sending to users when pass reset.

Post by fman »

'smtp.mailserver.com.br:587' -> you have to remove the port from host.
you need to add a different new config option to manage PORT or FORCE it on existent code, or wait till fix for 1.9.0
Fosco
TestLink user
Posts: 4
Joined: Thu Dec 30, 2010 1:11 pm

Re: [SOLVED] Email Not sending to users when pass reset.

Post by Fosco »

Looking for a solution I've try this and now is working!

Requirements from my SMTP server
1 - Don't use SSL
2 - User autentication
3 - Use the port 587

I configured config.inc.php as that

Code: Select all

/* [SMTP] */

$g_smtp_host        = 'smtp.mailserver.com.br:';  # SMTP server MUST BE configured

# Configure using custom_config.inc.php
$g_tl_admin_email     = 'mail@mailsever.com.br'; # for problem/error notification
$g_from_email         = 'mail@mailserver.com.br';  # email sender
$g_return_path_email  = 'mail@mailserver.com.br';

/** Configure only if SMTP server requires authentication */
$g_smtp_username    = 'mail@mailserver.com.br';  # user
$g_smtp_password    = 'password';  # password
And in file .../third_party/phpmailer/class.smtp.php

I defined the port in the function 'Connect' assigning value to variable $port, as that

Code: Select all

function Connect($host,$port=0,$tval=30) {
        $this->error = null;
        if($this->connected()) {
            $this->error =
                array("error" => "Already connected to a server");
            return false;
        }
       $port = 587; # Force to use the port 587
        if(empty($port)) {
            $port = $this->SMTP_PORT;
        }

...
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: [SOLVED] Email Not sending to users when pass reset.

Post by fman »

would you mind ti help us, getting attached fix on mantis 4131, applying it to your installation to test it ?
Post Reply