Menu

#2735 SMTP Mail configuration not working - mrbs - 1.11.0

None
closed
nobody
None
1
2023-04-04
2023-03-30
No

(Transferred from the general mailing list)

I tried to configure the mailing system for the booker using SMTP but it seems to be not working. Tried it on both local and server.

Can you please help me out here? it will be very much grateful of the team for the help. much appreciated.

Discussion

1 2 > >> (Page 1 of 2)
  • Campbell Morrison

    Have you tried debugging it using

    $mail_settings['debug'] = true;
    
     
  • Anonymous

    Anonymous - 2023-03-31

    Yes i did, but aparently it doesnt show any error on browser.

     
  • Campbell Morrison

    The debug information will be in your PHP error log. If you want it to appear in your browser set

    $mail_settings['debug_output'] = 'browser';
    
     
  • Anonymous

    Anonymous - 2023-03-31

    This is what i have in the config.inc.php at the end.
    i have added this configurartion for the mail but it is not working. i dont recieve mail neither at "Forgot Password" nor after booking the meeting.
    Please help me out

    $debug = true;
    $mail_settings['debug'] = true;
    $mail_settings['debug_output'] = 'browser';

    $mail_settings['admin_backend'] = 'smtp';
    $mail_settings['details'] = true;
    $mail_settings['html'] = true;
    $mail_settings['booker'] = true;
    $mail_settings['from'] = 'no-reply@neoniche.net';
    $mail_settings['use_from_for_all_mail'] = false;

    $smtp_settings['host'] = 'smtp-relay.sendinblue.com';
    $smtp_settings['port'] = 25;
    $smtp_settings['secure'] = 'ttl';
    $smtp_settings['username'] = '';
    $smtp_settings['password'] = '';

     
  • Campbell Morrison

    Are you getting any debug output?

     
  • Anonymous

    Anonymous - 2023-03-31

    i do get debug output but its noting related to the Email.

     
  • Anonymous

    Anonymous - 2023-03-31

    E_USER_NOTICE in /var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php at line 402
    Unknown database type '(Ubuntu)'

    and some language file warnings and deprecated error output.

     
  • Anonymous

    Anonymous - 2023-03-31

    Please help me campbell. i m struggling with this since last three days and with no output.
    i m kinda worried right now :(
    i am hopefull that you can help me with this.

     
  • Anonymous

    Anonymous - 2023-03-31

    I am using the same configuration on my other php projects for the Mail configuration and mails are working there.
    Like i kept port as 587 and secure as ttl.
    i m adding username password and trying but mail is not getting sent.

    i also tired to dig in file but the mail sending function is not getting called (i guess, i m not sure not good with OOPs).

    Idk what step i m missing here. Rest every thing seems to be working fine except the mail feature

    $debug = true;
    $mail_settings['debug'] = true;
    $mail_settings['debug_output'] = 'browser';

    $mail_settings['admin_backend'] = 'smtp';
    $mail_settings['details'] = true;
    $mail_settings['html'] = true;
    $mail_settings['booker'] = true;
    $mail_settings['from'] = 'no-reply@neoniche.net';
    $mail_settings['use_from_for_all_mail'] = false;

    $smtp_settings['host'] = 'smtp-relay.sendinblue.com';
    $smtp_settings['port'] = 587;
    $smtp_settings['secure'] = 'ttl';
    $smtp_settings['username'] = '';
    $smtp_settings['password'] = '';

     
  • Campbell Morrison

    Switch to sending the mail debug output to your error log

    $mail_settings['debug_output'] = 'log';
    

    and have a look in your PHP error log for debug output.

     
  • Anonymous

    Anonymous - 2023-03-31

    tried that as well but no log file is created

     
  • Anonymous

    Anonymous - 2023-03-31
    E_USER_NOTICE in /var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php at line 402
    Unknown database type '(Ubuntu)'
    #0 MRBS\generate_backtrace() called at [/var/www/neonichesolutions/mrbs/functions_error.inc:221]
    #1 MRBS\output_error() called at [/var/www/neonichesolutions/mrbs/functions_error.inc:251]
    #2 MRBS\error_handler(1024, Unknown database type '(Ubuntu)', /var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php, 402)
    #3 trigger_error(Unknown database type '(Ubuntu)') called at [/var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php:402]
    #4 MRBS\DB_mysql->dbType() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php:416]
    #5 MRBS\DB_mysql->checkVersion() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/DB_mysql.php:78]
    #6 MRBS\DB_mysql->construct(****, ****, ****, mrbs, false, NULL, array) called at [/var/www/neonichesolutions/mrbs/lib/MRBS/DBFactory.php:28]
    #7 MRBS\DBFactory::create(mysql, 3.6.131.215, workbenchneonichedbuser, Neoniche@@350#2#, mrbs, false, NULL, array) called at [/var/www/neonichesolutions/mrbs/dbsys.inc:63]
    #8 MRBS\db() called at [/var/www/neonichesolutions/mrbs/dbsys.inc:74]
    #9 MRBS\db_schema_version() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/Session/Session.php:57]
    #10 MRBS\Session\Session->init(2592000) called at [/var/www/neonichesolutions/mrbs/lib/MRBS/Session/Session.php:24]
    #11 MRBS\Session\Session->construct() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/Session/SessionWithLogin.php:32]
    #12 MRBS\Session\SessionWithLogin->construct() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/Session/SessionPhp.php:20]
    #13 MRBS\Session\SessionPhp->construct() called at [/var/www/neonichesolutions/mrbs/lib/MRBS/Session/SessionFactory.php:14]
    #14 MRBS\Session\SessionFactory::create(php) called at [/var/www/neonichesolutions/mrbs/mrbs_auth.inc:33]
    #15 MRBS\session() called at [/var/www/neonichesolutions/mrbs/init.inc:29]
    #16 require_once(/var/www/neonichesolutions/mrbs/init.inc) called at [/var/www/neonichesolutions/mrbs/defaultincludes.inc:34]
    #17 require(/var/www/neonichesolutions/mrbs/defaultincludes.inc) called at [/var/www/neonichesolutions/mrbs/reset_password.php:14]
    
     

    Last edit: Campbell Morrison 2023-03-31
  • Campbell Morrison

    Send the debug output to the log and look for your PHP error log. If you turn off $debug = true; then all your other debug output will go to the log as well so you will know you have found your log.

    Then try making a new booking.

    By the way, I have edited out your database credentials from the debug output above. You might want to consider changing your username and password.

     
  • Anonymous

    Anonymous - 2023-03-31

    I am trying that.
    Thank you so much for the editing out the username password. i have initiated the password change.
    i will check the log file asap. i m not usre though if it is being generated at all

     
  • Anonymous

    Anonymous - 2023-03-31

    Hi Campbell, tried doing $debug = 'false' and set mail debug to log file but there was no log file generated.

     
  • Campbell Morrison

    Run the attached test program and it will tell you where your error log is.

     
  • Anonymous

    Anonymous - 2023-03-31

    Hi sir, I ran the following file and it doesnt give me any path or output. i checked the code and echoed "Hello" but nope it didnt show me the error log path.
    just blank screen

     
  • Campbell Morrison

    In that case you need to modify your php.ini file so that error logging is enabled and you need to specify an error log file.

     
  • Anonymous

    Anonymous - 2023-03-31

    Hi Campbell,

    Thanks so much for this log file instruction i did that.

    following is the error i got in my log file. What do i do here?

    [31-Mar-2023 14:41:12 Asia/Kolkata] SERVER -> CLIENT: 250-smtp-relay.sendinblue.com Nice to meet you, [43.204.191.80]
    250-PIPELINING
    250-8BITMIME
    250 AUTH LOGIN PLAIN CRAM-MD5
    
    [31-Mar-2023 14:41:12 Asia/Kolkata] CLIENT -> SERVER: MAIL FROM:<no-reply@neoniche.net>
    
    [31-Mar-2023 14:41:12 Asia/Kolkata] SERVER -> CLIENT: 530 Error: authentication Required
    
    [31-Mar-2023 14:41:12 Asia/Kolkata] SMTP ERROR: MAIL FROM command failed: 530 Error: authentication Required
    
    [31-Mar-2023 14:41:12 Asia/Kolkata] The following From address failed: no-reply@neoniche.net : MAIL FROM command failed,Error: authentication Required
    ,530,SMTP server error: MAIL FROM command failed Detail: Error: authentication Required
     SMTP code: 530
    [31-Mar-2023 14:41:12 Asia/Kolkata] Error sending email: The following From address failed: no-reply@neoniche.net : MAIL FROM command failed,Error: authentication Required
    ,530,SMTP server error: MAIL FROM command failed Detail: Error: authentication Required
     SMTP code: 530SMTP server error: MAIL FROM command failed Detail: Error: authentication Required
     SMTP code: 530
    [31-Mar-2023 14:41:12 Asia/Kolkata] [DEBUG] Failed to send email: The following From address failed: no-reply@neoniche.net : MAIL FROM command failed,Error: authentication Required
    ,530,SMTP server error: MAIL FROM command failed Detail: Error: authentication Required
     SMTP code: 530SMTP server error: MAIL FROM command failed Detail: Error: authentication Required
     SMTP code: 530
    
     

    Last edit: Campbell Morrison 2023-03-31
  • Campbell Morrison

    Try commenting out the line

    $smtp_settings['secure'] = 'ttl';
    

    'ttl' is not a valid option.

     
  • Campbell Morrison

    You also need to set

    $smtp_settings['auth'] = true;
    
     
  • Anonymous

    Anonymous - 2023-03-31

    okay. I am checking this,

     
  • Philippe

    Philippe - 2023-03-31

    Hello Campbell,

    Sorry to jump into this discussion but it looks like I'm having the same sort of issue when trying to set smtp.
    Reason is the smtp server from my provider (Ionos) is known to be blacklisted almost everywhere, so I wanted to use of my "secured" smtp's.
    Turns out that setting $mail_settings['debug'] = true;displays a nice output telling me that the message has been sent. Testing it with my own email address as recipient, I then get a returning error message stating that either SPF or DKIM protocols must be set....
    I'm for instance trying with smtp.orange.fr, one of the major providers in France. I do have an account and all stuff and yet the msg gets back with an invalid auth....

    Any idea as to how this could be addressed or am I making a mistake anywhere?

    Thx

    Philippe

     
    • Campbell Morrison

      Sorry, this is a different issue. Could you raise a separate ticket for it please? Thanks.

       
  • Anonymous

    Anonymous - 2023-04-03

    Hi Campbell, My mail seems to be working now but the secure $smtp_settings['secure'] = ''; is blank wont that be a problem?

     
1 2 > >> (Page 1 of 2)