diff --git a/public/language/en-GB/admin/settings/email.json b/public/language/en-GB/admin/settings/email.json
index e6f92fb8ec..93ffe374f9 100644
--- a/public/language/en-GB/admin/settings/email.json
+++ b/public/language/en-GB/admin/settings/email.json
@@ -13,6 +13,7 @@
"smtp-transport.service-help": "Select a service name above in order to use the known information about it. Alternatively, select "Custom Service" and enter the details below.",
"smtp-transport.gmail-warning1": "If you are using GMail as your email provider, you will have to generate an "App Password" in order for NodeBB to authenticate successfully. You can generate one at the App Passwords page.",
"smtp-transport.gmail-warning2": "For more information about this workaround, please consult this NodeMailer article on the issue. An alternative would be to utilise a third-party emailer plugin such as SendGrid, Mailgun, etc. Browse available plugins here.",
+ "smtp-transport.auto-enable-toast": "It looks like you're configuring an SMTP transport. We enabled the \"SMTP Transport\" option for you.",
"smtp-transport.host": "SMTP Host",
"smtp-transport.port": "SMTP Port",
"smtp-transport.security": "Connection security",
diff --git a/public/src/admin/settings/email.js b/public/src/admin/settings/email.js
index 20f5d8587d..e1598c2c0b 100644
--- a/public/src/admin/settings/email.js
+++ b/public/src/admin/settings/email.js
@@ -108,6 +108,18 @@ define('admin/settings/email', ['ace/ace', 'alerts', 'admin/settings'], function
function handleSmtpServiceChange() {
const isCustom = $('[id="email:smtpTransport:service"]').val() === 'nodebb-custom-smtp';
$('[id="email:smtpTransport:custom-service"]')[isCustom ? 'slideDown' : 'slideUp'](isCustom);
+
+ const enabledEl = document.getElementById('email:smtpTransport:enabled');
+ if (enabledEl) {
+ if (!enabledEl.checked) {
+ enabledEl.closest('label').classList.toggle('is-checked', true);
+ enabledEl.checked = true;
+ alerts.alert({
+ message: '[[admin/settings/email:smtp-transport.auto-enable-toast]]',
+ timeout: 5000,
+ });
+ }
+ }
}
return module;