0

I am currently using GMAIL less secure app method to send email from my website. Since it no longer works due to Google blocking the emails to be sent, I am now shifting to Oauth method.

I followed all the steps mentioned in the following article and was able to complete all the steps successfully except the last one. https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2

In the last step when I try to visit the URL and select google as the provider it just displays: [website] is currently unable to handle this request. HTTP ERROR 500

Things I tried:

  1. Deactivating all plugins
  2. Increasing PHP memory limit

My website generally is not facing Error 500 problem. It displays this only while accessing the URL where the get_oauth_token.php resides on the website (as directed to do in the article)

halfer
  • 19,824
  • 17
  • 99
  • 186
Far
  • 341
  • 2
  • 11
  • 25
  • Check the [error log](https://stackoverflow.com/questions/5127838/where-does-php-store-the-error-log-php5-apache-fastcgi-cpanel) to find the real error message. Without that, we're working blind. – M. Eriksson Aug 10 '20 at 07:56
  • @MagnusEriksson There is no error belonging to this thing in the error_log. The last error is of yesterday which is related to something else – Far Aug 10 '20 at 08:27
  • If you have a 500 error, it will be in your log. If it's not, you need to fix your PHP installation before looking at your code. – Synchro Aug 10 '20 at 08:35
  • @Synchro But my website is all working fine. None of its pages show this except this URL which is needed just the first time to configure. PHP already came installed on the hosting so can there be any corrupted files in it by any chance? – Far Aug 10 '20 at 09:19
  • @Synchro The Error log has errors belong to the coding I did yesterday which I already solved and there is no other errors – Far Aug 10 '20 at 09:20
  • Then enable error output by some other means, for example by setting `ini_set('display_errors', true);` *temporarily*. – Synchro Aug 10 '20 at 09:22
  • Thats already set to true – Far Aug 10 '20 at 09:23
  • Are you sure the error is coming from your site? – Synchro Aug 10 '20 at 09:24
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/219536/discussion-between-far-and-synchro). – Far Aug 10 '20 at 09:24
  • 1
    Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Aug 10 '20 at 10:40
  • You may find that it is easier to use a third-party mail host, such as MailChimp. They have an API and I would expect they would have an SMTP offering. – halfer Aug 10 '20 at 10:41
  • I switched to another third party mail host which proved to be life saver for me.. https://www.socketlabs.com/blog/email-api-php/. Good and very easy to implement. They also have a free plan. Best if looking for a quick solution rather than going with PHP mailer Gmail oauth2 – Far Aug 10 '20 at 14:00

0 Answers0