jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: marcow on 31.08.2017 08:30:25

Title: Download notification email not working - [Not a jDownloads problem]
Post by: marcow on 31.08.2017 08:30:25
Hi Arno,

I'm having trouble receiving email notifications of user downloads.

Joomla 3.7.5
jDownloads 3.2.54
PHP 5.6.31

Although the Joomla is set to use PHP Mail, and the test mails by Joomla do arrive, the jDownload notifications do not.

Please advice.
Thanks,
Marco.
Title: Re: Download notification email not working
Post by: ColinM on 31.08.2017 13:11:29
Marco
I have just checked on my test site and all is well.
Could you first check your mail setup in the Joomla! Global Config - Server tab.
Ensure you have things set up and make sure field 'Mailer' set to  PHP mail - see pic
That has a Test Email button.  Does that send an email OK?
Colin

[gelöscht durch Administrator]
Title: Re: Download notification email not working
Post by: marcow on 31.08.2017 13:42:55
Hi, Thanks for responding,

As I wrote in my initial message:
  "Although the Joomla is set to use PHP Mail, and the test mails by Joomla do arrive, the jDownload notifications do not."

Any pointers would be helpful. If I can provide more info, please ask.

Regards,
Marco.
Title: Re: Download notification email not working
Post by: marcow on 01.09.2017 08:41:30
I have no idea how to find any debug info which could help me find the error at hand. Anyone any ideas?
Title: Re: Download notification email not working
Post by: marcow on 01.09.2017 09:57:17
Getting deeper into the code.

jDownloads uses a mailer object, which returns an error about sendmail not getting instantiated.
Joomla uses PHP Mail which uses JMail. JMail is a wrapper around PHP Mailer.

There obviously is a difference in behaviour or configuration. The test email by Joomla, using PHP Mail, works fine.
The jDownloads mailer object does not.

..
Title: Re: Download notification email not working
Post by: marcow on 01.09.2017 10:46:58
Mmh, finally managed to track down the issue. The test mail by Joomla was sent properly, but all other emails in Joomla failed to arrive. Strange, and it put me barking up the wrong tree.

Anyway, as soon as I configured Joomla to use SMTP, everything started working for Joomla itself.

Then my debug code was still telling me jDownloads didn't send the mail. This could be due to wrong "mailer->send" return handling. So I changed a few lines in jdownloadshelper.php to fix this.

        // Send the Mail
// NO LONGER::        $result = $mailer->send();
// FIXED THE RESULT HANLDING:
        if ( $mailer->send() ) {
            return true;
        } else {
            //JFactory::getApplication()->enqueueMessage(JText::_('COM_JDOWNLOADS_DB_ERROR'), 'error');
            return false;
        }         

I hope my little adventure may help others.
Title: Re: Download notification email not working
Post by: Arno on 01.09.2017 11:50:13
Hi Marco,
I wonder that we should have a bug here. I know that this functionality is use very often by our users. And nobody has until today problems reported like yours. Also for Colin works it. But I will check it in the next days.
Title: Re: Download notification email not working
Post by: marcow on 01.09.2017 11:56:46
Hi Arno,

I only noticed it because I was debugging the "if then else" in combination with a "echo "NOT SEND"; die;" routine which triggered while I finally managed to receive an email. Perhaps I mistook during coding/debugging/fixing, but I believe the current adjustments work appropriately.
Title: Re: Download notification email not working
Post by: Arno on 01.09.2017 13:03:50
Hi Marco,
I could not confirm your problem. See pic. Maybe an abnormality with your server settings or Joomla installation?


[gelöscht durch Administrator]
Title: Re: Download notification email not working
Post by: marcow on 01.09.2017 16:00:00
My site is now working. So no critical issue right now. And you're correct on the site configuration. It is now obvious that it was all due to a "sendmail" configuration issue.

Thanks for trying and assisting.

Ps. I do think my adjustment in code if ($mailer->send()) { is correct. Could you check that. I'm not a daily PHP coder.