In SMTPPai this provider is labeled Google Workplace/Gmail. It does not use a normal Gmail password. You create a Google Cloud OAuth client, paste the Client ID and Secret, add the exact redirect URI, then click Connect to Google. SMTPPai sends through Gmail SMTP (smtp.gmail.com, port 587, TLS) using OAuth (XOAUTH2).
When to choose Google Workplace/Gmail
- You want mail to leave from a real Google mailbox (Workspace or personal Gmail allowed by your Google Cloud app setup).
- You can create an OAuth Web application in Google Cloud Console.
- You accept that OAuth authorization goes through the MailPai auth relay at
https://auth.mailpai.com/google.
Prerequisites
- A Google account that can create projects in Google Cloud Console.
- Gmail API enabled for the project.
- An OAuth consent screen configured for the accounts you will sign in with.
- For Google Workspace, a Web application OAuth client (and any admin policies that allow the app).
Open SMTPPai
- SMTPPai → Dashboard → Add connection
- Click Google Workplace/Gmail
Field-by-field setup
Connection name
Example: “Gmail — WordPress”.
From name / From email
For Google mailboxes, From email is usually filled automatically after you authorize. Recipients see this Google address (or alias your Google account allows).
Application Client ID
- Open Google Cloud → Credentials.
- Create credentials → OAuth client ID → Application type Web application.
- Copy the Client ID into SMTPPai’s Application Client ID field.
Enable the Gmail API and include the Gmail send scope your Google app requires for SMTP OAuth.
Application Client Secret
From the same OAuth client, copy the Client secret into Application Client Secret. Treat it like a password.
Authorized Redirect URI
- In SMTPPai, copy the readonly redirect URI shown on the form.
- It must be exactly:
https://auth.mailpai.com/google - In Google Cloud, open your OAuth client → Authorized redirect URIs → add that URI → Save.
You do not put your WordPress site URL in Google Console for this flow. The auth relay returns you to WordPress after Google signs you in.
Credential storage
- Store keys in database — Client ID/Secret stored (encrypted when possible); refresh token stored after Connect.
- Keep in wp-config.php:
define( 'MAILPAI_SMTP_OAUTH_GOOGLE_CLIENT_ID', 'your-client-id' ); define( 'MAILPAI_SMTP_OAUTH_GOOGLE_CLIENT_SECRET', 'your-client-secret' );
Connect to Google (required)
- Save the connection first.
- On the Dashboard card, click Connect to Google.
- Sign in with the Google account that should send mail.
- Approve the requested permissions.
- Wait to return to WordPress. The connection should show as authorized.
Without this step, tests will fail even if Client ID and Secret are correct.
Save and test
- Click Test, enter a recipient, send.
- Confirm in Email Log.
- Trigger a real WordPress password reset to yourself as a final check.
Common failures
- Redirect URI mismatch (extra slash, http vs https, or using the site URL instead of
auth.mailpai.com) - Gmail API not enabled
- OAuth consent screen blocking the user (testing mode / unverified app limits)
- Skipped Connect to Google
- Workspace admin blocking third-party OAuth apps
Related: How connections work · Send a test email · Microsoft 365/Outlook
