Sending SMTP email from PHP Script hosted on Hostgator Servers
its in your gmail settings; you need to allow your website to send emails;
to do so go to https://accounts.google.com/DisplayUnlockCaptcha and click continue; then useyour website to send email an email; and google will detect your login attempt and allow you.