I'm trying to send emails with CodeIgniter using
smtp.googlemail.com. No problems with code but Google is preventing me from sending that email - here's the email I received on my Google account:
A third party recently tried to use an application to connect to your Google account.
We blocked the connection attempt in case it would be a hacker trying to access your account.
If you have not made this connection attempt, it may mean a third party is trying to access your account. We recommend that you log into your account and reset your password immediately. We blocked the connection attempt in case it would be a hacker trying to access your account.
If this is your account and if you are having trouble to get there, follow the troubleshooting procedure explained at http://support.google.com/mail?p=client_login.
I have followed the link and didn't find a solution.
I have the same issue, got an email from Google saying "Sign-in attempt prevented" when I was trying the same. I am ignoring what you have received from google and the text of email. Finally I solved the issue to send mail using CodeIgniter Email library today.
To use Google SMTP in CodeIgniter you need to make 2 (two) changes into Gmail account setting: (N.B. Please be aware that it is now easier for an attacker to break into your account -says Google)<ol> <li>Set off <strong>2-step Verification</strong>.</li> <li><strong>Allow less secure apps</strong>: ON (or Enable)</li> </ol>
ssl://smtp.gmail.com instead of
Hope this help.