• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot send mail via SMTP (version 3.16)

#1
I cannot send mail via SMTP, i'm using gmail account in this case.
There is my config:

$config['protocol'] = 'smtp';
$config['smtp_host'] = "ssl://smtp.googlemail.com";
$config['smtp_port'] = 465;
$config['smtp_user'] = 'email';
$config['smtp_pass'] = 'password';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

I've tried to login gmail using my email and my password, and I can logged in.
and I've changed "Allow less secure apps" to ON , but still does not send email.


The result of debug on attached files.
Thank you


Attached Files Thumbnail(s)
   
Reply

#2
Google seems to be replying with a bad password or email address. Have you verified they're good?

I'm not familiar with using google's smtp but I seems to remember having to use an app specific password to log in when using two factor authentication, I'd verify that as well if you are.
Reply

#3
(10-26-2017, 03:19 PM)enlivenapp Wrote: Google seems to be replying with a bad password or email address.   Have you verified they're good?

I'm not familiar with using google's smtp but I seems to remember having to use an app specific password to log in when using two factor authentication, I'd verify that as well if you are.

I've tried to login normally on web, that's good

but I've tried to add third party library (phpmailer), I can send mail
Reply

#4
Yeah, I got that you could login normally and phpmailer isn't working.

Try reading the error you got. "Username and password not accepted"...

Are you using two factor authentication?
Reply

#5
(10-27-2017, 10:29 AM)enlivenapp Wrote: Yeah, I got that you could login normally and phpmailer isn't working.

Try reading the error you got. "Username and password not accepted"...

Are you using two factor authentication?

I mean when i add "phpmailer" as third party library, i can send mail, but the included library from codeigniter i cannot send mail. I've tried 2 months a go and that is normal (on previous version not 3.16) I can send mail.

two factor authentication is off

should I turn it on?

Thank You So Much for attention and help #smile
Reply

#6
If your running on a localhost you need to setup SMTP in the php.ini file.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#7
@Rifky Pujiyansyah Suropaty

If PHPMailer works, you may try this library of mine, it extends CI_Email: https://github.com/ivantcholakov/codeigniter-phpmailer
Just install it within your application and write/use your configuration data. You would not need to change your application code for sending emails, leave it as it is, in CodeIgniter style. Thus PHPMailer would do the job hidden behind the CodeIgniter's API.

Second, not mandatory: It would be better, if you try to use tls (port 587), it is a newer way encryption that is also supported by Gmail.
Reply

#8
I've had trouble with Gmail SMTP myself recently (a month ago). Everything worked fine - and then it stopped - on all my sites using SMTP Gmail. Anyway I'm using sendmail everywhere now and it works. (CI 3.1.5)
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.