{"id":22,"date":"2026-03-29T14:47:13","date_gmt":"2026-03-29T14:47:13","guid":{"rendered":"https:\/\/photonconsole.com\/blog\/?p=22"},"modified":"2026-04-16T09:07:44","modified_gmt":"2026-04-16T09:07:44","slug":"smtp-authentication-error","status":"publish","type":"post","link":"https:\/\/photonconsole.com\/blog\/smtp-authentication-error\/","title":{"rendered":"SMTP Authentication Error: Causes &amp; Solutions (Fix SMTP Error 535 Step-by-Step)"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Your transactional emails have stopped sending. OTP codes are not reaching users. Password reset emails are failing silently. Your application looks broken to every new visitor trying to sign up. And somewhere in your error logs, there is a line that reads: <strong>535 Authentication Failed<\/strong> or <strong>Username and Password not accepted<\/strong>.<\/p>\n\n\n\n<p>SMTP authentication errors are one of the most disruptive email failures a developer or website owner can face. They block critical communication, damage user trust, and are often caused by something as simple as a missing app password or a disabled SMTP setting. This guide explains exactly why SMTP authentication errors happen and how to fix them permanently, step by step.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Why SMTP Authentication Error Happens (Quick Answer)<\/h2>\n\n\n\n<p>An SMTP authentication error occurs when the mail server rejects the login credentials provided during the email sending process. The most common causes are wrong username or password, using an account password instead of an app-specific password, two-factor authentication blocking the login, SMTP access being disabled on the email account, or incorrect SMTP host and port settings in the application configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What Is SMTP Authentication?<\/h2>\n\n\n\n<p>SMTP authentication (often called SMTP AUTH) is the process by which an email client or application proves its identity to a mail server before being permitted to send emails. When your application calls an SMTP server, the server asks for a username and password. If those credentials are verified, the server allows the email to be sent. If authentication fails, the server returns an error code and the email is not delivered. Most SMTP authentication errors occur due to incorrect credentials or missing app password configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Common SMTP Authentication Error Messages<\/h2>\n\n\n\n<p>Recognizing the exact error message helps narrow down the cause quickly. The most frequent SMTP authentication error messages include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>535 Authentication Failed<\/strong> \u2013 The server rejected the login attempt entirely.<\/li>\n\n\n\n<li><strong>535 5.7.8 Username and Password not accepted<\/strong> \u2013 Common with Gmail; usually means an app password is needed.<\/li>\n\n\n\n<li><strong>SMTP Login Failed<\/strong> \u2013 Generic error from many mail clients and plugins.<\/li>\n\n\n\n<li><strong>Authentication Unsuccessful<\/strong> \u2013 Common in Microsoft and Office 365 environments.<\/li>\n\n\n\n<li><strong>534-5.7.9 Please log in with your web browser and then try again<\/strong> \u2013 Google flagging a suspicious or blocked login attempt.<\/li>\n\n\n\n<li><strong>530 5.7.0 Must issue a STARTTLS command first<\/strong> \u2013 Encryption mismatch between client and server.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Main Causes of SMTP Authentication Error<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Wrong Username or Password<\/h3>\n\n\n\n<p>The most straightforward cause is entering the wrong email address or password in the SMTP configuration. This happens during initial setup, after a password change, or when migrating servers. Even a single misplaced character in the password field will cause a 535 error.<\/p>\n\n\n\n<p><strong>Example:<\/strong> You recently changed your Gmail password but forgot to update the password in your WordPress SMTP plugin. Every email attempt now fails with a login error.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Using Account Password Instead of App Password<\/h3>\n\n\n\n<p>Google, Microsoft, and other providers no longer allow applications to use your main account password for SMTP access. You must generate a dedicated <strong>app password<\/strong> from your account security settings and use that in your application instead.<\/p>\n\n\n\n<p><strong>Example:<\/strong> A developer configures Nodemailer with their Gmail address and regular password. Gmail blocks the login because it requires an app-specific password for third-party SMTP access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Two-Factor Authentication Issues<\/h3>\n\n\n\n<p>When two-factor authentication (2FA) is enabled on your email account, logging in via SMTP using your regular password is blocked by design. The provider expects you to use an app password that bypasses the 2FA prompt for machine-to-machine connections.<\/p>\n\n\n\n<p><strong>Example:<\/strong> An Office 365 account has MFA enforced by the administrator. A PHP application trying to send emails via that account&#8217;s SMTP credentials keeps receiving an authentication failure until an app password or OAuth token is configured.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. SMTP Access Disabled<\/h3>\n\n\n\n<p>Many email providers disable SMTP access by default or after detecting suspicious activity. If SMTP sending has not been explicitly enabled in your email account settings, all authentication attempts will fail regardless of whether the credentials are correct.<\/p>\n\n\n\n<p><strong>Example:<\/strong> A newly created Gmail account has IMAP enabled but SMTP relay not configured. The application cannot send emails until SMTP access is turned on from the Google Admin Console or account settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Incorrect SMTP Settings<\/h3>\n\n\n\n<p>Using the wrong SMTP host, port, or encryption protocol causes the connection to reach the wrong endpoint, leading to authentication failures. Mixing up port 465 (SSL) with port 587 (TLS) is a common configuration mistake.<\/p>\n\n\n\n<p><strong>Example:<\/strong> A WordPress site is configured with <code>smtp.gmail.com<\/code> on port 25 with no encryption. Gmail does not accept unauthenticated SMTP on port 25, so every email fails.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Hosting Restrictions<\/h3>\n\n\n\n<p>Shared hosting providers frequently block outgoing connections on SMTP ports (25, 465, 587) to prevent spam abuse. Your application may have perfect credentials, but the firewall on the server-side will silently drop the connection before authentication can even occur.<\/p>\n\n\n\n<p><strong>Example:<\/strong> A Laravel application on a shared cPanel host cannot connect to an external SMTP server because the host blocks outbound port 587. The error appears as a connection timeout or authentication failure depending on how the client handles it.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How to Fix SMTP Authentication Error (Step-by-Step)<\/h2>\n\n\n\n<p><strong>Quick Fix \u2013 Most Common Solution:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable 2-Step Verification on your Google or Microsoft account<\/li>\n\n\n\n<li>Generate a dedicated app password from your account security settings<\/li>\n\n\n\n<li>Replace your regular account password with the app password in your SMTP config<\/li>\n\n\n\n<li>Verify SMTP host, port, and encryption match your provider&#8217;s requirements<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Verify Credentials<\/h3>\n\n\n\n<p>Start with the basics. Open your SMTP configuration file, plugin settings, or environment variables and confirm that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The username is the full email address, not just the username part (e.g., <code>you@yourdomain.com<\/code>, not <code>you<\/code>)<\/li>\n\n\n\n<li>The password is current and has not been changed recently<\/li>\n\n\n\n<li>There are no extra spaces, hidden characters, or encoding issues in the password field<\/li>\n<\/ul>\n\n\n\n<p>Try logging into the email account manually through a browser to confirm the credentials work at the account level before debugging the application layer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Use an App Password<\/h3>\n\n\n\n<p>If your email provider supports or requires app passwords, generate one and use it in place of your main account password. This is mandatory for Gmail when 2-Step Verification is enabled, and strongly recommended for Microsoft 365 accounts with MFA.<\/p>\n\n\n\n<p><strong>For Gmail:<\/strong> Go to your Google Account &gt; Security &gt; 2-Step Verification &gt; App passwords. Select &#8220;Mail&#8221; and your device, then copy the generated 16-character password. Use this in your SMTP configuration. Refer to <a href=\"https:\/\/support.google.com\/accounts\/answer\/185833\" target=\"_blank\" rel=\"noreferrer noopener\">Google&#8217;s official app password guide<\/a> for the most current steps.<\/p>\n\n\n\n<p><strong>For Microsoft 365:<\/strong> Navigate to your Microsoft account &gt; Security &gt; Advanced security options &gt; App passwords. Microsoft&#8217;s <a href=\"https:\/\/support.microsoft.com\/en-us\/account-billing\/using-app-passwords-with-apps-that-don-t-support-two-step-verification-5896ed9b-4263-e681-128a-a6f2979a7944\" target=\"_blank\" rel=\"noreferrer noopener\">official app password documentation<\/a> walks through the full process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Enable SMTP Access on Your Email Account<\/h3>\n\n\n\n<p>Verify that SMTP sending is enabled on your email account, not just IMAP or POP access.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gmail:<\/strong> Go to Settings > See all settings > Forwarding and POP\/IMAP. Enable IMAP (which also unlocks SMTP sending).<\/li>\n\n\n\n<li><strong>Google Workspace:<\/strong> In Google Admin Console, go to Apps > Google Workspace > Gmail > End User Access and enable SMTP relay.<\/li>\n\n\n\n<li><strong>Microsoft 365:<\/strong> Go to Microsoft 365 Admin Center > Active users > Select user > Mail > Manage email apps. Enable Authenticated SMTP.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Check SMTP Configuration<\/h3>\n\n\n\n<p>Cross-reference your application&#8217;s SMTP settings against your provider&#8217;s official documentation. Misconfiguration is one of the leading causes of authentication failures. Here is a reference for the most common providers:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Provider<\/th><th>SMTP Host<\/th><th>Port (TLS)<\/th><th>Port (SSL)<\/th><\/tr><\/thead><tbody><tr><td>Gmail<\/td><td>smtp.gmail.com<\/td><td>587<\/td><td>465<\/td><\/tr><tr><td>Outlook \/ Hotmail<\/td><td>smtp-mail.outlook.com<\/td><td>587<\/td><td>N\/A<\/td><\/tr><tr><td>Microsoft 365<\/td><td>smtp.office365.com<\/td><td>587<\/td><td>N\/A<\/td><\/tr><tr><td>Yahoo Mail<\/td><td>smtp.mail.yahoo.com<\/td><td>587<\/td><td>465<\/td><\/tr><tr><td>PhotonConsole<\/td><td>smtp.photonconsole.com<\/td><td>587<\/td><td>465<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Fix Port and Encryption Settings<\/h3>\n\n\n\n<p>Using the wrong port or encryption method is a silent configuration error. The mail server will either refuse the connection or fail authentication because the handshake does not match expectations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Port 587 + STARTTLS (TLS)<\/strong> \u2013 The recommended modern configuration for most providers.<\/li>\n\n\n\n<li><strong>Port 465 + SSL\/TLS<\/strong> \u2013 Used by providers that require implicit SSL from the start of the connection.<\/li>\n\n\n\n<li><strong>Port 25<\/strong> \u2013 Reserved for server-to-server communication. Do not use for authenticated client SMTP sending.<\/li>\n<\/ul>\n\n\n\n<p>Always match the encryption setting in your application (TLS vs SSL) to the port number. Mismatching these two values is a very common cause of authentication failures that appear identical to credential errors in the logs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Use a Reliable SMTP Service<\/h3>\n\n\n\n<p>Here is where most people reach a breaking point: personal and business email accounts like Gmail and Outlook were not designed for high-volume application email sending. They have sending limits, rate restrictions, security blocks, and deliver poor results for transactional email at scale.<\/p>\n\n\n\n<p>Switching to a dedicated <a href=\"https:\/\/www.photonconsole.com\/relay.php\">SMTP relay service<\/a> like <a href=\"https:\/\/www.photonconsole.com\/\">PhotonConsole<\/a> eliminates most authentication errors permanently because:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Credentials are stable and specifically designed for application use<\/li>\n\n\n\n<li>No 2FA complications or app password requirements<\/li>\n\n\n\n<li>SMTP access is always enabled and monitored<\/li>\n\n\n\n<li>Infrastructure is purpose-built for transactional and bulk email delivery<\/li>\n\n\n\n<li>SPF, DKIM, and DMARC are pre-configured for high deliverability<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">SMTP Authentication Error in Different Platforms<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Gmail<\/h2>\n\n\n\n<p>Gmail is the most common source of SMTP authentication errors for developers. The 535 5.7.8 error almost always means you are using your regular account password instead of a generated app password. Google requires app passwords for all third-party SMTP clients when 2-Step Verification is active. Additionally, Google may temporarily block access if it detects a login from an unrecognized application or location, showing the &#8220;Please log in with your web browser&#8221; error.<\/p>\n\n\n\n<p><strong>Fix:<\/strong> Enable 2-Step Verification, generate an app password, and use that 16-character password in your SMTP settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress<\/h2>\n\n\n\n<p>WordPress sends emails through PHP&#8217;s built-in <code>mail()<\/code> function by default, which bypasses SMTP authentication entirely and relies on the server&#8217;s sendmail binary. This setup has poor deliverability and frequently fails on managed hosting. The fix is to use an SMTP plugin (WP Mail SMTP, FluentSMTP, or Post SMTP) and configure it with proper credentials.<\/p>\n\n\n\n<p><strong>Quick Fix for WordPress SMTP Authentication Error:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install WP Mail SMTP or Post SMTP plugin<\/li>\n\n\n\n<li>Enter your SMTP host, port, username, and app password<\/li>\n\n\n\n<li>Set encryption to TLS and port to 587<\/li>\n\n\n\n<li>Send a test email from the plugin dashboard<\/li>\n\n\n\n<li>Check plugin logs if the test fails for the exact error code<\/li>\n<\/ul>\n\n\n\n<p>If your hosting provider blocks outgoing SMTP ports, switching to a dedicated <a href=\"https:\/\/www.photonconsole.com\/relay.php\">SMTP relay service<\/a> is the most reliable solution, as it typically operates over alternative ports or HTTPS-based APIs that bypass hosting restrictions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PHPMailer<\/h2>\n\n\n\n<p>PHPMailer is one of the most widely used PHP libraries for sending email. Authentication errors in PHPMailer are usually caused by incorrect credentials, missing <code>SMTPAuth<\/code> flag, or wrong encryption settings.<\/p>\n\n\n\n<p>A correct PHPMailer configuration for Gmail looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n$mail = new PHPMailer(true);\n$mail-&amp;gt;isSMTP();\n$mail-&amp;gt;Host       = 'smtp.gmail.com';\n$mail-&amp;gt;SMTPAuth   = true;\n$mail-&amp;gt;Username   = 'you@gmail.com';\n$mail-&amp;gt;Password   = 'your-app-password';\n$mail-&amp;gt;SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;\n$mail-&amp;gt;Port       = 587;\n<\/code><\/pre>\n\n\n\n<p>Set <code>SMTPAuth<\/code> to <code>true<\/code> and always use an app password, not your regular Gmail password. Enable SMTP debugging with <code>$mail-&gt;SMTPDebug = 2;<\/code> to see the full server response during troubleshooting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Nodemailer<\/h2>\n\n\n\n<p>For Node.js applications using Nodemailer, SMTP authentication errors typically surface as <code>Invalid login<\/code> or <code>535 Authentication credentials invalid<\/code>. The most common fix is identical to PHPMailer: use an app password and verify the service and port.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nconst transporter = nodemailer.createTransport({\n  host: 'smtp.gmail.com',\n  port: 587,\n  secure: false,\n  auth: {\n    user: 'you@gmail.com',\n    pass: 'your-app-password'\n  }\n});\n<\/code><\/pre>\n\n\n\n<p>Set <code>secure: false<\/code> when using port 587 with STARTTLS. Set <code>secure: true<\/code> when using port 465 with SSL. Mixing these values will cause a TLS handshake failure that looks like an authentication error.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">When to Use a Dedicated SMTP Service<\/h2>\n\n\n\n<p>If you are repeatedly dealing with SMTP authentication errors, hitting Gmail sending limits, or watching emails land in spam, these are infrastructure problems \u2014 not configuration problems. No amount of credential tweaking will fix a Gmail account that was never designed to send thousands of transactional emails per day.<\/p>\n\n\n\n<p>A dedicated <a href=\"https:\/\/www.photonconsole.com\/\">email delivery service<\/a> like PhotonConsole is built specifically for this use case. It provides stable SMTP credentials that never expire, a high-deliverability relay infrastructure with pre-configured SPF and DKIM, email logs and delivery tracking, and a pay-as-you-use pricing model that scales with your business. You can review available plans on the <a href=\"https:\/\/www.photonconsole.com\/pricing.php\">PhotonConsole pricing page<\/a>.<\/p>\n\n\n\n<p>Unlike Gmail or Outlook, a purpose-built SMTP relay does not have the security restrictions, 2FA complications, or account-level sending limits that cause most authentication errors in the first place.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">SMTP Authentication Error \u2013 Quick Fix Summary Table<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Error Message<\/th><th>Most Likely Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>535 Authentication Failed<\/td><td>Wrong username or password<\/td><td>Verify credentials, use app password<\/td><\/tr><tr><td>535 5.7.8 Username and Password not accepted<\/td><td>Regular password used instead of app password<\/td><td>Generate and use a Google app password<\/td><\/tr><tr><td>SMTP Login Failed<\/td><td>Wrong credentials or SMTP disabled<\/td><td>Enable SMTP access, verify login<\/td><\/tr><tr><td>Authentication Unsuccessful<\/td><td>MFA blocking access (Microsoft 365)<\/td><td>Create an app password or use OAuth<\/td><\/tr><tr><td>534 Please log in via your browser<\/td><td>Google security block<\/td><td>Use app password, review security alerts<\/td><\/tr><tr><td>530 Must issue STARTTLS first<\/td><td>Encryption mismatch<\/td><td>Set encryption to TLS, port to 587<\/td><\/tr><tr><td>Connection Timeout<\/td><td>Hosting blocking outbound SMTP ports<\/td><td>Use a dedicated SMTP relay service<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Pro Tips to Avoid SMTP Authentication Errors<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Never use your main account password for SMTP.<\/strong> Always generate an app password or use API-based authentication when available.<\/li>\n\n\n\n<li><strong>Store credentials in environment variables.<\/strong> Hardcoding SMTP passwords in source code leads to accidental exposure and makes credential rotation painful.<\/li>\n\n\n\n<li><strong>Test your email configuration before deploying.<\/strong> Use tools like <a href=\"https:\/\/www.mail-tester.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mail Tester<\/a> or <a href=\"https:\/\/mxtoolbox.com\/emailhealth\/\" target=\"_blank\" rel=\"noreferrer noopener\">MXToolbox Email Health<\/a> to verify SMTP connectivity and authentication before going live.<\/li>\n\n\n\n<li><strong>Set up SPF, DKIM, and DMARC records.<\/strong> Authentication failures sometimes happen at the DNS level, not just the SMTP credential level. Missing or misconfigured email authentication records can cause delivery failures that look like SMTP errors.<\/li>\n\n\n\n<li><strong>Monitor SMTP logs regularly.<\/strong> Most frameworks and SMTP plugins provide logs. Checking them proactively catches credential expiration or rate-limit issues before they become outages.<\/li>\n\n\n\n<li><strong>Rotate app passwords periodically.<\/strong> If you suspect a credential has been exposed or if you receive unexpected authentication failures, regenerate the app password immediately and update all dependent applications.<\/li>\n\n\n\n<li><strong>Use a dedicated sending domain.<\/strong> Sending transactional email from your primary domain&#8217;s Gmail account puts your entire email reputation at risk. A dedicated subdomain (e.g., <code>mail.yourdomain.com<\/code>) with a reliable SMTP relay keeps business and application email separate.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Related SMTP Issues You Might Face<\/h2>\n\n\n\n<p>SMTP authentication errors are often part of a broader set of email delivery problems. Once authentication is resolved, you may still encounter the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SMTP Not Working:<\/strong> The connection never establishes. Usually a firewall, wrong host, or blocked port issue rather than a credentials problem.<\/li>\n\n\n\n<li><strong>SMTP Connection Error:<\/strong> The client times out before authentication can begin. Often caused by hosting providers blocking outbound SMTP ports.<\/li>\n\n\n\n<li><strong>SMTP Server Not Sending Emails:<\/strong> Authentication succeeds but emails do not arrive. The cause is usually deliverability issues, a full queue, or DNS misconfiguration.<\/li>\n\n\n\n<li><strong>Emails Going to Spam:<\/strong> A deliverability issue caused by missing SPF\/DKIM records, sending from a low-reputation IP, or email content triggering spam filters.<\/li>\n\n\n\n<li><strong>SMTP Rate Limiting:<\/strong> The server accepts authentication but throttles or rejects messages after a daily quota is reached. Common when using Gmail for application sending.<\/li>\n<\/ul>\n\n\n\n<p><strong>Quick Fix \u2013 If Authentication Passes But Emails Still Fail:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check SPF and DKIM DNS records using MXToolbox<\/li>\n\n\n\n<li>Verify the sender address matches the authenticated account<\/li>\n\n\n\n<li>Review SMTP server logs for bounce or rejection messages<\/li>\n\n\n\n<li>Test deliverability with mail-tester.com before sending in volume<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What does SMTP error 535 mean?<\/h3>\n\n\n\n<p>SMTP error 535 means the mail server rejected the authentication attempt. The server received the username and password but could not verify them. This usually means the credentials are wrong, an app password is required, or SMTP access is disabled on the account.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I fix &#8220;Username and Password not accepted&#8221; in Gmail?<\/h3>\n\n\n\n<p>Enable 2-Step Verification on your Google account, then go to Security &gt; App passwords and generate a new app password for mail. Use that 16-character password in your SMTP configuration instead of your regular Gmail password.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does my SMTP authentication keep failing even with the correct password?<\/h3>\n\n\n\n<p>If credentials are correct but authentication still fails, the most likely cause is that your email provider requires an app password (not your account password) for SMTP access, or that SMTP access has not been enabled on the account. Two-factor authentication and hosting-level firewall blocks are also common culprits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is port 465 or 587 better for SMTP?<\/h3>\n\n\n\n<p>Port 587 with STARTTLS is the recommended modern standard for client SMTP submission. Port 465 with implicit SSL is also widely supported and acceptable. Avoid port 25 for application-level sending, as it is reserved for server-to-server mail transfer and is frequently blocked by hosting providers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I use Gmail SMTP for sending application emails?<\/h3>\n\n\n\n<p>Gmail SMTP can be used for low-volume application email sending, but it has a 500-emails-per-day limit for regular accounts and 2,000 for Workspace accounts. It also requires app passwords, has security restrictions, and is not designed for reliable transactional email delivery at scale. A dedicated SMTP relay service is a better long-term choice for production applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between SMTP authentication and email authentication?<\/h3>\n\n\n\n<p>SMTP authentication refers to the login process when your application connects to the SMTP server (username and password). Email authentication refers to DNS-level protocols (SPF, DKIM, DMARC) that prove the email was sent from an authorized server. Both are necessary for reliable email delivery.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I test if my SMTP settings are correct?<\/h3>\n\n\n\n<p>Use a tool like MXToolbox SMTP diagnostics or send a test email through your application with SMTP debug logging enabled. PHPMailer supports <code>SMTPDebug = 2<\/code> and Nodemailer supports a <code>debug: true<\/code> option that prints the full server conversation to the console.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>SMTP authentication errors are not random. They are almost always caused by a specific, fixable configuration issue: wrong credentials, a missing app password, a disabled SMTP setting, or a port mismatch. Authentication failures are one of the most common causes of email delivery issues in web applications, and they can be resolved systematically by following the steps in this guide.<\/p>\n\n\n\n<p>For developers and businesses sending critical transactional email, the real long-term solution is to stop relying on consumer email accounts as your SMTP backend. Gmail and Outlook impose daily sending limits, require complex security workarounds, and are not designed for production application email. Every hour of downtime caused by an SMTP authentication failure is a user who did not receive their OTP, a customer who never got their order confirmation, and revenue that was silently lost.<\/p>\n\n\n\n<p>A purpose-built <a href=\"https:\/\/www.photonconsole.com\/\">email delivery service<\/a> like PhotonConsole solves this at the infrastructure level. Stable SMTP credentials, pre-configured SPF and DKIM, a high-deliverability relay network, and email tracking logs that make debugging fast and simple. If you are ready to stop chasing authentication errors and start sending reliably, explore the <a href=\"https:\/\/www.photonconsole.com\/relay.php\">PhotonConsole SMTP relay<\/a> and review the <a href=\"https:\/\/www.photonconsole.com\/pricing.php\">pricing options<\/a> that scale with your sending volume.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Read More<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/photonconsole.com\/blog\/smtp-not-working-10-common-errors-how-to-fix-them-step-by-step-guide\/\">SMTP Not Working? 10 Common Errors and How to Fix Them (Step-by-Step Guide)<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Your transactional emails have stopped sending. OTP codes are not reaching users. Password reset emails are failing silently. Your application looks broken to every new visitor trying to sign up. And somewhere in your error logs, there is a line that reads: 535 Authentication Failed or Username and Password not accepted. SMTP authentication errors are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":23,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,31],"tags":[5,11,27,15,23,26],"class_list":["post-22","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email-deliverability","category-smpt-relay-service","tag-email-deliverability","tag-email-infrastructure","tag-email-sending-failed","tag-smtp-relay-service","tag-smtp-server-not-sending-emails","tag-smtp-tls-ssl-error"],"_links":{"self":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":1,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/22\/revisions\/24"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/media\/23"}],"wp:attachment":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}