Issue with email sending using gmail.

1,632 views
Skip to first unread message

Dibyadutta Barkataki

unread,
May 15, 2018, 2:53:38 AM5/15/18
to jorani
Hello,

I am having issue with sending of emails from jorani using gmail. I am using AWS EC2 server.

The testmail page shows the following.

Test of your e-mail configuration
INFO: Selecting SMTP Protocol.
INFO: SMTP with crypto.
SERVER -> CLIENT: 220 smtp.gmail.com ESMTP k2-v6sm17600743pfg.82 - gsmtp
CLIENT -> SERVER: EHLO 13.232.9.11
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [13.232.9.11]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
CLIENT -> SERVER: EHLO 13.232.9.11
SERVER -> CLIENT: 250-smtp.gmail.com at your service, [13.232.9.11]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
CLIENT -> SERVER: MAIL FROM:
SERVER -> CLIENT: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp
SMTP ERROR: MAIL FROM command failed: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp
The following From address failed: user...@gmail.com : MAIL FROM command failed,Authentication Required. Learn more at
https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp
,530,5.5.1SMTP server error: MAIL FROM command failed Detail: Authentication Required. Learn more at
https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp
SMTP code: 530 Additional SMTP info: 5.5.1ERROR: PHPMailer has encountered an error.
The following From address failed: user...@gmail.com : MAIL FROM command failed,Authentication Required. Learn more at https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp ,530,5.5.1SMTP server error: MAIL FROM command failed Detail: Authentication Required. Learn more at https://support.google.com/mail/?p=WantAuthError k2-v6sm17600743pfg.82 - gsmtp SMTP code: 530 Additional SMTP info: 5.5.1 

 I have included my email configs below. Have changed the uername and password of gmail account in here.

<?php defined('BASEPATH') OR exit('No direct script access allowed.');
$config['useragent']        = 'PHPMailer';             // Mail engine switcher: 'CodeIgniter$
$config['protocol']         = 'smtp';                   // 'mail', 'sendmail', or 'smtp'
$config['mailpath']         = '/usr/sbin/sendmail';
$config['smtp_host']        = 'smtp.gmail.com';
$config['smtp_user']        = 'user...@gmail.com';
$config['smtp_pass']        = 'password';
$config['smtp_port']        = 587;
$config['smtp_timeout']     = 30;                       // (in seconds)
$config['smtp_crypto']      = 'tls';                       // '' or 'tls' or 'ssl'
$config['smtp_debug']       = 4;                        // PHPMailer's SMTP debug info level$
$config['smtp_auto_tls']    = FALSE;                     // Whether to enable TLS encryption$
$config['smtp_conn_options'] = array();                 // SMTP connection options, an array$
$config['wordwrap']         = TRUE;
$config['wrapchars']        = 76;
$config['mailtype']         = 'html';                   // 'text' or 'html'
$config['charset']          = 'UTF-8';                  // 'UTF-8', 'ISO-8859-15', ...; NULL$
$config['validate']         = TRUE;
$config['priority']         = 3;                        // 1, 2, 3, 4, 5; on PHPMailer usera$
$config['crlf']             = "\n";                     // "\r\n" or "\n" or "\r"
$config['newline']          = "\n";                     // "\r\n" or "\n" or "\r"
$config['bcc_batch_mode']   = FALSE;
$config['bcc_batch_size']   = 200;
$config['encoding']         = '8bit';                   // The body encoding. For CodeIgnite$
// DKIM Signing
// See https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
// See http://stackoverflow.com/questions/24463425/send-mail-in-phpmailer-using-dkim-keys
// See https://github.com/PHPMailer/PHPMailer/blob/v5.2.14/test/phpmailerTest.php#L1708
$config['dkim_domain']      = '';                       // DKIM signing domain name, for exm$
$config['dkim_private']     = '';                       // DKIM private key, set as a file p$
$config['dkim_private_string'] = '';                    // DKIM private key, set directly fr$
$config['dkim_selector']    = '';                       // DKIM selector.
$config['dkim_passphrase']  = '';                       // DKIM passphrase, used if your key$
$config['dkim_identity']    = '';                       // DKIM Identity, usually the email $


Also, I have set  Allow less secure apps: ON on my gmail account.

Server config are as follows

Web Server
RequirementValue / Description
 Server softwareApache/2.4.18 (Ubuntu)
  Allow overwrite (.htaccess files)On (used for cool URLs) Ignore this message if you are running something else than Apache.
  Apache module rewrite (mod_rewrite)1 (used for cool URLs) Ignore this message if you are running something else than Apache.
  Apache module gzip (mod_gzip)Off Improve response times.
 PHP 5.6.0+Ignore this message if you are running an exotic PHP runtime
 PHP7.0.28-0ubuntu0.16.04.1
 Timezone undefinedIf error, please check date.timezone into PHP.ini.
 mb_strimwidth function existsPHP must be compiled with multibyte string support.
 json_encode function existsPHP must be compiled with json support.
 Jorani can write into logs folderThe folder application/logs/ must be writable.
 Jorani can write filesThe folder local/upload/leaves/ must be writable.
 pdo_mysql is LOADEDPDO/mysql is the recommended database driver.
 OPcache is LOADEDPlease consider activating OPcache for the best performances.
 openssl is LOADEDPHP Extension openssl is required if you use PHP7.1.
 curl is LOADEDPHP Extension curl is needed for OAuth2 authentication.
 ldap IS NOT LOADEDPHP Extension ldap is optional and allows you to use LDAP for authentication.
 zip is LOADEDPHP Extension zip allows you to use the export to Excel feature.
 xml is LOADEDPHP Extension xml allows you to use the export to Excel feature.
 gd is LOADEDPHP Extension gd2 allows you to use the export to Excel feature.
Additional configuration
You can test the following settings, but you need to edit the corresponding PHP scripts :
  • SSL Configuration and Utility.
  • OAuth2 Settings.
  • E-mail Settings.
  • LDAP Settings.
  • OPCache Tester.
Database
RequirementValue / Description
 Configuration fileFound
 Database connectionOK
 Database queryOK
 Database proceduresOK
 Organization structureOK


I have also set the "email from" field in the config file.

what could be the issue here ?

Dibyadutta Barkataki

Benjamin BALET

unread,
May 19, 2018, 3:43:54 AM5/19/18
to jor...@googlegroups.com
It looks like you are missing one variable, please read the doc:

--
You received this message because you are subscribed to the Google Groups "jorani" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.
To view this discussion on the web visit https://groups.google.com/d/msgid/jorani/d44143df-9168-444c-8547-27fe69500f27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dibyadutta Barkataki

unread,
May 19, 2018, 8:51:26 AM5/19/18
to jor...@googlegroups.com
Ii added the 
$config['_smtp_auth'] = TRUE;
in the email.php file on my server.

But It is not in the source code files in 

After adding the code, the mail was sent. 

Maybe it could be added in the source code of the email.php file like 
$config['_smtp_auth'] = FALSE; //Change this to true if using Gmail

Really appreciate the help.
Thank you.



Benjamin BALET

unread,
May 20, 2018, 9:04:46 PM5/20/18
to jor...@googlegroups.com
Hi,

GMail is not used by most of users who are relying on an internal server or on their ISP.
It was included into the code in the past, but it is confusing to many users.
I had so many questions related to that, so I decided to remove it.

Reply all
Reply to author
Forward
0 new messages