x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

GoogleOAuthSMTP plugin

From LimeSurvey Manual

 Hint: This feature is available starting in version 6.3.0


GoogleOAuthSMTP is a core plugin that lets LimeSurvey send email through a Gmail or Google Workspace account using OAuth2, instead of a plain SMTP username and password. This is required because Google no longer allows "less secure apps" / plain password sign-in for sending mail through its SMTP servers — an app has to authenticate with an OAuth2 token instead.

  This plugin requires LimeSurvey to be served over HTTPS. Google's OAuth process will not work over a plain HTTP connection, and the plugin will refuse to proceed until this is the case.


Setting it up

1. Create OAuth 2.0 credentials in Google Cloud

In the Google Cloud Platform Console, create an OAuth 2.0 Web Application credential. When asked for an authorized redirect URI, use the exact URI shown on this plugin's own settings page (Configuration -> Plugin manager -> GoogleOAuthSMTP -> Settings) — it will look similar to:

https://your-limesurvey-domain/index.php/admin/smtpOAuth/sa/receiveOAuthResponse

See Google's documentation on setting up OAuth 2.0 for details on creating the credential itself. Once created, note down the Client ID and Client Secret Google gives you.

2. Activate the plugin

Go to Configuration -> Plugin manager and activate GoogleOAuthSMTP. It ships inactive by default.

3. Enter your credentials

Open the plugin's settings (Configuration -> Plugin manager -> GoogleOAuthSMTP -> Settings) and fill in:

  • Client ID
  • Client Secret

Save the settings.

  The Client Secret field is a plain text field, not a masked password field — anyone with access to this settings screen, or to the database, can read it. Restrict access to the Plugin Manager and to database access accordingly.


4. Authorize with your Google account

Still on the plugin's settings page, click Get new token (or Get token). This opens a popup window showing Google's consent screen. Log in with the Google account that should send LimeSurvey's email, and accept the requested permissions. Once done, the popup closes itself automatically and the settings page updates.

The permission requested is full access to the Google account's mail (send and read) — Google does not offer a narrower, send-only scope for this kind of integration.

After a successful authorization, the settings page shows the Token owner email address: the Google account that was just authorized. All outgoing mail will be sent from this address — there is no separate "sender address" setting.

5. Select this plugin as the email method

Go to Configuration -> Global settings -> Email settings and set:

  • Email method: Plugin
  • Email plugin: Google

Once "Plugin" is selected, the regular SMTP host/username/password/encryption fields are hidden and no longer used — this plugin connects to Gmail's SMTP server directly and does not read those fields at all.

To confirm everything works, use the regular Send test email button on the same Email settings tab — there is no separate test button specific to this plugin.

Status and troubleshooting

The plugin's settings page shows a status message reflecting the current state of its configuration:

  • Configuration is complete (or similar): a valid, working refresh token is stored — nothing to do.
  • Requirement not met: typically means the site is not being served over HTTPS.
  • Credentials incomplete: Client ID and/or Client Secret are not filled in yet.
  • No token: Client ID/Secret are set, but authorization (step 4) has not been completed yet.
  • Invalid token: a token was obtained previously, but Google no longer accepts it (for example, because access was revoked from the Google account, or too much time has passed). Click Get new token again to re-authorize.
Changing the Client ID or Client Secret and saving automatically clears any previously stored token, since a token is only valid for the credentials it was issued against. You will need to authorize again (step 4) after changing either value.

If the Google account's access is revoked, or the OAuth consent is otherwise invalidated outside of LimeSurvey, sending mail will fail (visible as a send error/exception, and in the log) until the site is re-authorized — this is not proactively flagged to administrators outside of the plugin's own settings page.

Limitations

  • No separate "from" address can be configured — outgoing mail is always sent as the Google account used to authorize the plugin.
  • Client ID, Client Secret and the stored refresh token are kept in the database without encryption, unlike LimeSurvey's own SMTP password field (which is encrypted). Treat access to Plugin Manager settings and to the database itself as access to these credentials.
  • Gmail overrides the visible "From" header with the authenticated account's address regardless of a survey's configured "From" name/address; the plugin works around this by adding that configured address as a Reply-To header, so replies still reach the intended recipient even though the visible sender is the authorized Gmail account.
  • There is no dedicated per-plugin test/send button; use the generic "Send test email" button under Global settings -> Email settings.