SMTP credential not working (No testing function found for this credential)

Describe the problem/error/question

After register new SMTP credential on lastest n8n Docker image (2.21.4), using Try button report:

Couldn’t connect with these settings:
No testing function found for this credential.

Credential used came from gmail in legacy mode and fully working.

Using simplre test workflow send only email, report:

Invalid login: 534-5.7.9 Application-specific password required. For more information, go to 534 5.7.9 ffacd0b85a97d-45da15a5653sm46903655f8f.35 - gsmtp

Registration same SMTP credential on n8n, 9 version ago (2.13.2) and same test workflow run great.

Register new SMTP credential seems to ignore password form field.

Stack trace from gui log:

NodeApiError: Invalid login: 534-5.7.9 Application-specific password required. For more information, go to
534 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor ffacd0b85a97d-45da15a5653sm46903655f8f.35 - gsmtp
    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/EmailSend/v2/send.operation.ts:276:10)
    at processTicksAndRejections (node:internal/process/task_queues:104:5)
    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/EmailSend/v2/EmailSendV2.node.ts:110:17)
    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1048:9)
    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1239:11)
    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1687:27
    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2339:11

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.21.4
  • Database (default: SQLite): Sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Alpine ?

@xfly51 u need google application password

u need 2fa on for that

please read Sign in with app passwords - Google Account Help

after u enable 2fa u can go here and create

it have a popup window with the application password

Welcome to the n8n community @xfly51

I would also validate whether the password field is persisted in the new credential as it seems to have been ignored after saving.

@xfly51 the App-Specific Password requirement on Gmail SMTP is mandatory now — regular Gmail password gets rejected with that 534-5.7.9 error even if it worked in older n8n versions (Google deprecated less-secure-apps support a while back).

fix is to enable 2-Step Verification on the Gmail account at myaccount.google.com/security if not already on, then generate an App Password at myaccount.google.com/apppasswords (pick “Mail” + your device). use that 16-char App Password in the SMTP credential’s Password field, not your regular Gmail password — the spaces in the App Password don’t matter, paste as-is or stripped.

the “No testing function found” error above the real auth failure is misleading by the way, n8n’s SMTP cred type just doesn’t have a built-in test endpoint, has nothing to do with the actual login issue. once the App Password is in place the send works.

Sorry but already set and fully working app password on gmail account to authenticate legacy applications (postfix).

Currently used to send email via authenticated SMTP:465/tls smtp.gmail.com .

Now following real problem…

On N8N, version 2.13.2 it’s working

But same configuration ( same user and same password ) fail to validate on version 2.21.4

If try to use in simpre workflow, credential set in credential set in relative section, receive:

Following exception:

{
“errorMessage”: “Credential with ID “u9YtbhWO9T2yUxQF” does not exist for type “smtp”.”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “2.21.4 (Self Hosted)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“Error: Credential with ID “u9YtbhWO9T2yUxQF” does not exist for type “smtp”.”,
" at CredentialsHelper.getCredentialsEntity (/usr/local/lib/node_modules/n8n/src/credentials-helper.ts:308:11)“,
" at CredentialsHelper.getDecrypted (/usr/local/lib/node_modules/n8n/src/credentials-helper.ts:381:29)”,
" at ExecuteContext.getCredentials (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:440:31)“,
" at ExecuteContext.getCredentials (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/node-execution-context/base-execute-context.ts:102:10)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/EmailSend/v2/send.operation.ts:181:22)“,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/EmailSend/v2/EmailSendV2.node.ts:110:17)”,
" at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1048:9)“,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1239:11)”,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1687:27",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2339:11"
]
}
}

N8n seems refuse save and valdiate credential in version 2.21.4. Repeat one more time, in vesrion 2.13.2 it’s fully working:

Hope now problem will be clear …

Update.

This mornign tested in docker envirnoment previous version.

Result:

  • version 2.21.5, 2.21.4: SMTP Credential validation fail;
  • version 2.20.11: SMTP Credential validation done!

Test result show n8n version 2.21.x (latest: 2.21.5) seems to be affected.

Thank you for sharing @xfly51

In this case, we kindly ask that you finalize this post by choosing the best answer to solve the issue and submit/register this question in the “Known Issues” category for better tracking by the n8n team.

I can confirm that, it drove me crazy, it’s definitely a bug. New credentials with different data don’t validate either. IMAP and SMTP work but without validation—but as an n8n newbie like me, that throws me off. (2.21.5, Docker). I almost messed everything up when deleting and reloading the DB.

sounds like 2.21.x broke the credential validation (separate from the missing test-function UI bug from 2.20.x) — if your existing app password worked on 2.20.11 and the same cred fails on 2.21.4/5, that’s a regression they shipped, nothing on your end.

practical workaround until they patch is to downgrade your docker image to n8nio/n8n:2.20.11 where the SMTP cred and send both worked. pin the version in your compose file with image: n8nio/n8n:2.20.11 or docker run n8nio/n8n:2.20.11 ....

worth filing in the Known Issues category for tracking by the n8n team.

I can confirm that the passwords, in my case SMTP for example, are saved and work, I just tested it with a test email in a test node.

The app password solution doesn’t apply here. Your problem is different.

The error Credential does not exist for type "smtp" indicates a credential migration issue during the update. I’ve seen this happen on multiple instances after major updates.

Did you use a fresh Docker volume when updating to 2.21.4 or did you continue using the existing one?

All test maded by containerized n8n ad fresh n8n data volume. No update and no import! Same problem in fresh authenticade postfix (no gmail app password). Tomorrow i’ll try again using latest n8n version.

Two separate issues here — let me untangle them.
Issue 1: “No testing function found for this credential”
This is a known UI issue in recent n8n versions. The SMTP credential type does not have a built-in test function, so the “Test” button has nothing to call. It does not mean your credential is broken — it means n8n literally has no test endpoint wired for SMTP. Ignore this message. The only way to test SMTP credentials is to send an actual email through a workflow.

Issue 2: “Application-specific password required” — this is the real problem
The error 534-5.7.9 Application-specific password required means Google is rejecting your login because you are using your regular Gmail password instead of an App Password.

What changed: Google removed “Less Secure Apps” access permanently. Even if your old credential worked on n8n 2.13.2, Google may have revoked legacy access since then. The n8n version upgrade is a coincidence — Google’s auth policy change is what broke it.

Fix — takes 2 minutes:

  1. Go to myaccount.google.com/security
  2. Make sure 2-Step Verification is turned ON (App Passwords require it)
  3. Go to myaccount.google.com/apppasswords
  4. Create a new App Password — select “Mail” and “Other (n8n)”
  5. Google gives you a 16-character password
  6. In n8n, edit your SMTP credential and replace your current password with this 16-character App Password

7. SMTP settings should be: Host smtp.gmail.com, Port 465, SSL ON

Do not use your regular Gmail password — it will always fail with this error now regardless of n8n version.
“Register new SMTP credential seems to ignore password form field”

This is likely not ignoring the password — it is sending it, but Google is rejecting it because it is not an App Password. Once you switch to the App Password, this will resolve.

@syed_noor as already described in my post 5 days ago, Application-specific password already set and running fine. It’s working in my local postfix and containerized n8n and I’m NOT using Gmail password instead of an App Password.

It’s not working, as show in screenshot, in latest version of n8n (second problem):

  • 2.13.2: working;
  • 2.20.11: working;
  • 2.21.5: (latest version) not working;

Test maded by:

  • dockerized n8n;
  • using fresh n8n data volume;
  • same login/password;

On same way, credential validation work only in following version (first problem):

  • 2.13.2: working;
  • 2.20.11: working;

Please read all thread in post before…