SMTP options

Install and configure FormaLMS and DoceboCE
Post Reply
kamaldua
Newbie
Posts: 17
Joined: Mon Jan 17, 2022 5:17 am

SMTP options

Post by kamaldua »

I am trying to make email work using sendgrid api but it does not work. FormaLMS shows email sent but nothing happens.
What are these options used for in config file:
$cfg['use_smtp_database'] = 'on';
$cfg['use_smtp'] = 'on';
$cfg['smtp_debug']
how setting $cfg['smtp_debug'] to say 3 can help debug? what does $cfg['use_smtp_database'] do?
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: SMTP options

Post by alfa24 »

When $cfg['use_smtp_database'] is 'on', credentials and connection parameters are stored in the DB, and you can set them in the backend (configuration).
Per supporto GRATUITO contattatemi in privato qui
kamaldua
Newbie
Posts: 17
Joined: Mon Jan 17, 2022 5:17 am

Re: SMTP options

Post by kamaldua »

There is problem with lib.mailer.php
SMTP values are not getting passed in SmtpAdm::getInstance()->

If I hardcode SMTP values in lib.mailer.php it works fine.
Where can we report bugs?
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: SMTP options

Post by alfa24 »

There is no public bug tracker.
You can post here your solution (if you have one).
Per supporto GRATUITO contattatemi in privato qui
kamaldua
Newbie
Posts: 17
Joined: Mon Jan 17, 2022 5:17 am

Re: SMTP options

Post by kamaldua »

following is solution:
I am not sure why original code is not working though looks ok:
File: /appCore/models/SmtpAdm.php
Original ( does not work):

Code: Select all

    public static function isEnabledDatabase()
    {
        $smtpConfigIsEnabled = Get::cfg('use_smtp_database');

        switch ($smtpConfigIsEnabled) {
            case 'on':
            case 'true':
            case true:
                return true;
                break;
            default:
                return false;
                break;

        }
    }
This works:

Code: Select all

    public static function isEnabledDatabase()
    {
        $smtpConfigIsEnabled = Get::cfg('use_smtp_database');

        switch ($smtpConfigIsEnabled) {
            case 'off':
		return false;
                break;
			case 'on':
            case 'true':
            case true:
                return true;
                break;
            default:
                return false;
                break;

        }
    }
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: SMTP options

Post by alfa24 »

what die(var_dump($smtpConfigIsEnabled)) would return in the non working case?
Per supporto GRATUITO contattatemi in privato qui
Post Reply