Announcement

#1 2022-03-16 19:36:02

trhessel
Member
2022-03-13
18

Not able to send email

Greetings,

First off I am loving the Piwigo platform and what I am able to do with it for ogranizing and displaying all my photos. I am having an issue that has been discussed on here in the past but I am not at all able to find a resolution to the problem. Trying to send contact form mail or password mail or new users mail update results in the following.

Fatal error: Uncaught Error: Class 'PHPMailer\PHPMailer\Exception' not found in /var/www/html/piwigo/include/phpmailer/PHPMailer.php:2146 Stack trace: #0 /var/www/html/piwigo/include/phpmailer/PHPMailer.php(1970): PHPMailer\PHPMailer\PHPMailer->smtpConnect() #1 /var/www/html/piwigo/include/phpmailer/PHPMailer.php(1648): PHPMailer\PHPMailer\PHPMailer->smtpSend() #2 /var/www/html/piwigo/include/phpmailer/PHPMailer.php(1486): PHPMailer\PHPMailer\PHPMailer->postSend() #3 /var/www/html/piwigo/include/functions_mail.inc.php(900): PHPMailer\PHPMailer\PHPMailer->send() #4 /var/www/html/piwigo/plugins/ContactForm/include/functions.inc.php(273): pwg_mail() #5 /var/www/html/piwigo/plugins/ContactForm/include/contact_form.inc.php(26): send_contact_form() #6 /var/www/html/piwigo/plugins/ContactForm/include/functions.inc.php(35): include('/var/www/html/p...') #7 /var/www/html/piwigo/include/functions_plugins.inc.php(264): contact_form_page() #8 /var/www/html/piwigo/index.php(351): trigger_notify() #9 {main} thrown in /var/www/html/piwigo/include/phpmailer/PHPMailer.php on line 2146

I found a few threads that that have offered a couple different solutions to this by editing some of the function or phpmailer files but none help resolve this. Anything anyone can help me with here wouuld be greatly appreciated.

Piwigo 12.2.0 Check for upgrade
Operating system: Linux
PHP: 7.4.3 (Show info) [2022-03-16 18:28:21]
MySQL: 5.5.5-10.3.34-MariaDB-0ubuntu0.20.04.1 [2022-03-16 18:28:21]
Graphics Library: GD 2.2.5

Offline

 

#2 2022-03-17 00:53:34

erAck
Only trying to help
2015-09-06
2026

Re: Not able to send email

This is just a completely untested quick idea..

In include/functions_mail.inc.php at line 609 there's

Code:

  include_once(PHPWG_ROOT_PATH.'include/phpmailer/SMTP.php');
  include_once(PHPWG_ROOT_PATH.'include/phpmailer/PHPMailer.php');

Try if before those two inserting the line

Code:

  include_once(PHPWG_ROOT_PATH.'include/phpmailer/Exception.php');

helps.

Note that if this helps it doesn't mean that mails will be sent, because an exception is usually thrown when something does not work as intended, but if it helps then at least the exception can be thrown and program flow continue (if the exception is caught) instead of a fatal error being generated.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2022-03-17 04:42:55

trhessel
Member
2022-03-13
18

Re: Not able to send email

Thank you, that did clear that error but landed me on this.

Warning
: Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ … leshooting in
/var/www/html/piwigo/include/functions_mail.inc.php
on line
904

While it sounds like a general connect error I am not finding where this is breaking down. Any suggestion on a log to look at would be helpful. I am able to telnet to my sendmail host on port 25 from this machine and via command line send an email and in the piwigo config I do have this in the local config section.

$conf['smtp_host'] = '192.168.1.5:25';
$conf['smtp_user'] = 'admin';
$conf['smtp_password'] = 'xxxxxxxxxx'; - redacted
$conf['mail_sender_email'] = 'admin@xxxxxx.xxxxxx'; - redacted
$conf['mail_allow_html'] = true;
$conf['smtp_secure'] = null;

Thank you in advance for any additional help you can provide.

Offline

 

#4 2022-03-17 05:09:19

trhessel
Member
2022-03-13
18

Re: Not able to send email

Ok so very interesting, I changed it from my local smtp relay direct to dreamhost with all the proper credentials and IT WORKED. Wow, I cannot thank you enough. I need to figure out why my local relay failed but that line did it, i cannot thank you enough and really appreciate your help.

Offline

 

#5 2022-03-19 13:22:25

erAck
Only trying to help
2015-09-06
2026

Re: Not able to send email

Fwiw, I created a pull request for this, https://github.com/Piwigo/Piwigo/pull/1633


Running Piwigo at https://erack.net/gallery/

Offline

 

#6 2022-03-19 23:49:38

trhessel
Member
2022-03-13
18

Re: Not able to send email

Thank you very much.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact