Title: Bad Request(invalid_grant) error?
Last modified: November 23, 2016

---

# Bad Request(invalid_grant) error?

 *  [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * (@southernroutes)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/)
 * Hello, Postman quietly stopped delivering emails a little over a month ago and
   no one noticed until now. We’re using it with WPForms and the form data is capturing
   and storing just fine, just no notification emails are going out. The error listed
   under status for the ones that didn’t deliver is “Bad Request(invalid_grant).”
 * Unfortunately, much of this flies over my head. Nothing changed in our settings
   and everything with the Google API Manager still matches up with what’s in the
   Postman settings. I did run the Connectivity test and everything seemed okay 
   except perhaps this line:
 * ✅ Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to ***********************************************
   instead of gmail.com.
 * Not sure what that means. Also, below is the output of the Diagnostic test:
 * —
    OS: Linux php-v157.wc2.dfw3.stabletransit.com 3.16.0-4-amd64 #1 SMP Debian
   3.16.36-1+deb8u2 (2016-10-19) x86_64 PHP: Linux 5.6.24-0+deb8u1 C PHP Dependencies:
   iconv=Yes, spl_autoload=Yes, openssl=Yes, sockets=Yes, allow_url_fopen=Yes, mcrypt
   =Yes, zlib_encode=Yes WordPress: 4.6.1 en_US UTF-8 WordPress Theme: Modern Portfolio
   Pro Theme WordPress Plugins: BackupBuddy, Genesis Simple Edits, Hello Bar (Official),
   iThemes Security Pro, iThemes Sync, Jetpack by WordPress.com, Meta Slider, Pin
   It Button for Pinterest, Postman SMTP, Simple Social Icons, Yoast SEO, WPForms
   Conditional Logic, WPForms Mailchimp, WPForms WordPress wp_mail Filter(s): wp_staticize_emoji_for_email
   Postman: 1.7.2 Postman Sender Domain (Envelope|Message): gmail.com | gmail.com
   Postman Prevent Message Sender Override (Email|Name): No | No Postman Active 
   Transport: SMTP (smtp:tls:oauth2://smtp.gmail.com:587) Postman Active Transport
   Status (Ready|Connected): Yes | Yes Postman Deliveries (Success|Fail): 344 | 
   81 —
 * Anyone else getting this error and resolved sending issues?
 * Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8474047)
 * > ✅ Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to ***********************************************
   > instead of gmail.com.
 * This warning means that another server has intercepted, and responded to, your
   request to gmail.com. This is known as a [Man-In-The-Middle attack](https://en.wikipedia.org/wiki/Man-in-the-middle_attack).
   I use the term loosely here, because it’s probably not a malicious effort, but
   rather your web host is capturing all TCP requests out on port 25 either for 
   security (to reduce SPAM originating from their IPs) or for convenience.
 * This is probably something new that they implemented, you guessed it, about a
   month ago.
 * Bottom line, OAuth 2.0 will no longer work in this configuration.
    -  This reply was modified 9 years, 6 months ago by [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/).
 *  Thread Starter [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * (@southernroutes)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8474071)
 * Thanks for the quick reply, Jason! So, what would be my next steps in either 
   getting this resolved or finding a more reliable method than OAth 2.0? For the
   record, the website is hosted at Rackspace. Thanks!
 *  Plugin Author [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8474085)
 * I just noticed that your Postman is actually configured for port 587.
 * In the Connectivity Test, do you get the warning on port 587 as well? Your post
   shows the warning on port 25 only.
 *  Thread Starter [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * (@southernroutes)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8474166)
 * Hi Jason, I probably should have pasted the whole output of the test. Here it
   is:
 * Begin Test
    Transport Socket Status* Service Available Server ID Authentication
   None Login Plain CRAM-MD5 OAuth 2.0 SMTP smtp.gmail.com:25 Open SMTP *************************************************
   Yes No No No No SMTP smtp.gmail.com:465 Open 🔒 SMTPS gmail.com No Yes Yes No
   Yes SMTP smtp.gmail.com:587 Open 🔒 SMTP-STARTTLS gmail.com No Yes Yes No Yes
   Gmail API [http://www.googleapis.com:443](http://www.googleapis.com:443) Open
   🔒 HTTPS googleapis.com n/a Mandrill API mandrillapp.com:443 Open 🔒 HTTPS mandrillapp.
   com n/a SendGrid API api.sendgrid.com:443 Open 🔒 HTTPS sendgrid.com n/a * According
   to portquiz.net
 * Summary:
 * ✅ Port 25 can be used for SMTP to smtp.gmail.com. Warning: connected to *************************************************
   instead of gmail.com.
    ✅ 🔒 Port 587 can be used for SMTP to smtp.gmail.com.
   ✅ 🔒 Port 443 can be used with the Gmail API. ✅ 🔒 Port 443 can be used with
   the SendGrid API. ✅ 🔒 Port 443 can be used with the Mandrill API. ✅ 🔒 Port
   465 can be used for SMTP to smtp.gmail.com.
 *  Thread Starter [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * (@southernroutes)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8474276)
 * Also, I should have said that we’re currently configured to send over port 587.
 * ![postman settings](https://i0.wp.com/datagraphicdesign.com/wp-content/uploads/
   2016/11/poastman-settings.jpg)
 *  Plugin Author [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/)
 * (@jasonhendriks)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8475040)
 * Oh, 587 seems fine. That’s odd. Perhaps try re-creating your Google OAuth 2 ID.
 * If it still doesn’t work, perhaps switch to the Gmail API on port 443?
    -  This reply was modified 9 years, 6 months ago by [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/).
    -  This reply was modified 9 years, 6 months ago by [Jason Hendriks](https://wordpress.org/support/users/jasonhendriks/).
 *  Thread Starter [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * (@southernroutes)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8475188)
 * Hi Jason, I created a new OAuth Client ID, entered the credentials and it appears
   to be working fine now. Thanks a lot for your help!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Bad Request(invalid_grant) error?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/postman-smtp_7c7b78.svg)
 * [Postman SMTP Mailer/Email Log](https://wordpress.org/plugins/postman-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/postman-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/postman-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/postman-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/postman-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/postman-smtp/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [southernroutes](https://wordpress.org/support/users/southernroutes/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/bad-requestinvalid_grant-error/#post-8475188)
 * Status: not resolved