All the documentation I'm seeing for sending emails from a gmail account specify to check the "allow less secure apps to access" setting in your google account. Apparently as of last week, Google has disabled that setting, at least for accounts with 2 step authentication (this was required for me, as I'm using a custom domain as an alias for a gmail address). The workaround I'm seeing is to create a one-time "app password" from google and set it as 'mail_password'. I'm trying switching around ssl/tls, as well as using the @gmail.com address name instead of the alias, and have had no success in getting the confirmation email to send after booking on a hosted installation of easy appointments.
I'm not seeing errors showing up in the console, is there a place where I should be able to see the errors/what exactly its problem is? Do I need a 'useragent'? Am I missing any necessary variables? Thanks,
application/config/email.php
<?php defined('BASEPATH') or exit('No direct script access allowed');
// $config['useragent'] = 'Easy!Appointments';
$config['protocol'] = 'smtp'; // or 'smtp'
$config['smtp_port'] = 587;
$config['mailtype'] = 'html'; // or 'text'
// $config['smtp_debug'] = '0'; // or '1'
// $config['smtp_auth'] = TRUE; //or FALSE for anonymous relay.
$config['smtp_host'] = 'smtp.gmail.com';
$config['mail_password']='<gmail one time app password>';
$config['smtp_user'] = '[email protected]'; //set up as an alias of a gmail account
$config['smtp_pass'] = '<gmail password>';
$config['smpt_timeout'] = 60;
$config['smtp_crypto'] = 'ssl'; // or 'tls'
I was able to find the error message incase of email sending failed cases like this.
Also, when I copied the app password from the google console, it has added spaces in between each character, which caused the failure. I have removed the spaces and it worked well. Hope this helps.