forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 email => Topic started by: RBiZ on August 10, 2012, 07:14:12 am

Title: Windows: Critical error The registration confirmation email can't be send!
Post by: RBiZ on August 10, 2012, 07:14:12 am
Critical error
The registration confirmation email can't be send!
Critical error
The password reminder email can't be sent!
I am using a Hostgator Personal Windows account, and am receiving the error message when i try to register a new user. I have tested many things, including leaving the smtp host blank, entering localhost, and entering the smtp hostname (the username (email address) & password fields are filled in with a working email on the server). After much testing, I went into the code in mailer.inc.php and changed from:
var $SMTPAuth     = false; to var $SMTPAuth     = true; since I believe that Hostgator requires authentication. This also did not work.

I found a post that may be a solution from September 2010 http://forum.coppermine-gallery.net/index.php/topic,66826.0.html , however it looks like the code in mailer.inc.php has been modified since then (Reply #15) so I did not attempt to modify my file that code.




Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: Αndré on August 10, 2012, 10:58:44 am
According to that post, try to change
Code: [Select]
ini_set('sendmail_from', $this->Sender);to something hard-coded as orb353 did.


I went into the code in mailer.inc.php and changed from:
var $SMTPAuth     = false; to var $SMTPAuth     = true; since I believe that Hostgator requires authentication. This also did not work.
There's no need to change that line. As far as I can see it won't be used at all.


Does sending emails with PHP's mail() function work? What's the error message with Coppermine's debug mode enabled?
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: RBiZ on August 10, 2012, 07:13:14 pm
Here are my errors in debug mode.
I am not sure how to test sending emails with PHP's mail() function

When smtp.bestfriendsvethospital.com is entered in SMTP HOST

\include\mailer.inc.php
•   Warning line 2114: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known.
•   Warning line 2114: fsockopen() [function.fsockopen]: unable to connect to smtp.bestfriendsvethospital.com:25 (php_network_getaddresses: getaddrinfo failed: No such host is known. )
•   CPG Notice line 1695: SMTP Error: Could not connect to SMTP host.



When SMTP HOST is left empty –
Listed in error is: register.php - Line: 627

include\mailer.inc.php
•   Warning line 588: mail() [function.mail]: SMTP server response: 550 <lakespyder@gmail.com> No such user here
•   CPG Notice line 1695: Could not instantiate mail function.



When localhost is entered in SMTP HOST

\include\mailer.inc.php
•   Warning line 2114: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )
•   CPG Notice line 1695: SMTP Error: Could not connect to SMTP host.



When SMTP HOST is left empty and I hardcoded the change below:
    if ($this->Sender != '' && strtolower(ini_get('safe_mode')) != 'on' && ini_get('safe_mode') != 1) {
      $old_from = ini_get('sendmail_from');
      //ini_set('sendmail_from', $this->Sender);
       ini_set('sendmail_from',"vet@bestfriendsvethospital.com");

\include\mailer.inc.php
•   Warning line 590: mail() [function.mail]: SMTP server response: 550 <ra@rbizmarketing.com> No such user here
•   CPG Notice line 1697: Could not instantiate mail function.


Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: Αndré on August 10, 2012, 07:48:20 pm
I am not sure how to test sending emails with PHP's mail() function
http://www.php.net/manual/en/function.mail.php


Could not instantiate mail function.
It seems that sendmail isn't installed or configured on your system. Please contact your hosting provider.
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: RBiZ on August 11, 2012, 05:54:02 pm
I am using a Hostgator Personal Windows account -
Here is what support at Hostgator says:
As far as sendmail being installed; You are on shared hosting environment and any application must use SMTP Authentication in order to send emails
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: Αndré on August 11, 2012, 08:19:22 pm
When smtp.bestfriendsvethospital.com is entered in SMTP HOST

\include\mailer.inc.php
•   Warning line 2114: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known.
•   Warning line 2114: fsockopen() [function.fsockopen]: unable to connect to smtp.bestfriendsvethospital.com:25 (php_network_getaddresses: getaddrinfo failed: No such host is known. )
•   CPG Notice line 1695: SMTP Error: Could not connect to SMTP host.


When localhost is entered in SMTP HOST

\include\mailer.inc.php
•   Warning line 2114: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )
•   CPG Notice line 1695: SMTP Error: Could not connect to SMTP host.


You have to enter valid SMTP data: smtp.bestfriendsvethospital.com doesn't exist and there's no SMTP server running at localhost.
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: RBiZ on August 11, 2012, 09:12:27 pm
The other forms (after much work due to the strict settings for hostgator windows hosting) work using CDO with this configuration (I had to use localhost to get it to work properly):
Sub SubmitEmail(strForm)
   Set objConfig = CreateObject("CDO.Configuration")
   Set Fields = objConfig.Fields

   With Fields
    .Item(cdoSendUsingMethod)       = 2
    .Item(cdoSMTPServer)            = "localhost"
    .Item(cdoSMTPServerPort)        = 25
    .Item(cdoSMTPuseSSL)            = False
    .Item(cdoSMTPConnectionTimeout) = 60
    .Item(cdoSMTPAuthenticate )     = 1
    .Item(cdoSendUserName)          = "vet@bestfriendsvethospital.com"
    .Item(cdoSendPassword)          = "password"
   
***********
This is why I thought i may need to modify the $SMTPAuth setting. I have also tested with it set as  var $SMTPAuth     = 1;
Still no luck.
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: RBiZ on August 14, 2012, 05:20:59 pm
Hostgator finally was able to get it working using: mail.url.com rather than smtp.url.com or localhost
I am not sure if they made any other modifications.
Thanks for your assistance!
Title: Re: Windows: Critical error The registration confirmation email can't be send!
Post by: Αndré on August 15, 2012, 12:01:32 am
Please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.