Wednesday, 4 March 2026
How to Configure SMTP for Gmail: A Complete Setup Guide
Technology

How to Configure SMTP for Gmail: A Complete Setup Guide

()

Email delivery is a crucial part of any modern website or application. Whether you’re sending contact form notifications, password resets, or marketing messages, you need a reliable mail server behind the scenes. Gmail’s SMTP service is one of the most trusted options because it’s secure, stable, and easy to integrate.

In this guide, you’ll learn how to correctly configure Gmail SMTP for websites, WordPress, applications, or custom software.


1. What Is Gmail SMTP?

SMTP (Simple Mail Transfer Protocol) is used to send outgoing emails.
Gmail provides secure SMTP servers you can use as your email-sending engine.

It’s free to use, but the daily sending limit typically ranges between 100–500 emails, depending on your activity and account type.


2. Gmail SMTP Server Settings (Latest)

Use the following details in your application or email client:

Setting Value
SMTP Server smtp.gmail.com
SMTP Port (TLS) 587
SMTP Port (SSL) 465
Authentication Required Yes
Encryption TLS / SSL
Username Your Gmail address
Password App Password (Recommended)

3. Enable 2-Step Verification (Required)

Google no longer supports “Less Secure Apps”.
To use SMTP safely, follow these steps:

Step 1: Turn On 2-Step Verification

  1. Go to myaccount.google.com/security

  2. Find “2-Step Verification”

  3. Enable it using your phone or authenticator app

This is required before you can generate your App Password.


4. Create an App Password for SMTP

App Passwords are special 16-digit codes that allow external apps to send emails securely.

To generate it:

  1. Visit Google Account → Security

  2. Under 2-Step Verification, click App Passwords

  3. Choose Mail as the app

  4. Choose Other → Enter your platform name (e.g., “WordPress SMTP”)

  5. Google will generate a 16-character password

Use this password in your SMTP configuration instead of your real email password.


5. Configure SMTP in WordPress (Example)

If you use WordPress, install a plugin like WP Mail SMTP.

Settings:

  • SMTP Host: smtp.gmail.com

  • SMTP Port: 587

  • Encryption: TLS

  • Authentication: Yes

  • Username: your Gmail address

  • Password: your App Password

Save settings and send a test email.
If everything is correct, the message will deliver instantly.


6. Configure SMTP in Custom Software

If you’re integrating SMTP into an app or script, here’s a general structure:

Example (PHP):

$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'your-app-password';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;

Example (Node.js using Nodemailer):

const transport = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: '[email protected]',
pass: 'your-app-password'
}
});

7. Common SMTP Gmail Errors & Fixes

Error: “Invalid Credentials”

→ Make sure you’re using an App Password, not your login password.

Error: “SMTP Connection Timeout”

→ Check if port 587 or 465 is blocked by hosting.

Error: “Authentication Required”

→ Ensure 2-Step Verification is enabled.

Error: “Daily Limit Exceeded”

→ Gmail has sending limits — consider using Google Workspace or a dedicated SMTP provider.


FAQs About Gmail SMTP Configuration

1. Is Gmail SMTP free?

Yes, Gmail SMTP is free for personal accounts but has sending limits.

2. Can I use Gmail SMTP for business websites?

Yes, but Google Workspace (paid) is recommended for higher sending limits.

3. Why use App Passwords instead of normal passwords?

They’re more secure and required by Google for external connections.

4. Does Gmail allow bulk email sending?

No, Gmail isn’t designed for bulk marketing emails.

5. What’s the best alternative if Gmail limits are too low?

Use SendGrid, Amazon SES, Mailgun, or a dedicated SMTP service.


Need SMTP Setup Help? Contact Visernic

Visernic provides professional email configuration and integration services.

📧 [email protected]
📞 +44 7577 062211 (WhatsApp Available)

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

SARFENAZ NAZ

Co-founder & Editor at Visernic Limited | Driving digital transformation through content, communication & strategy | Passionate about empowering global brands with clarity & creativity.

Leave a Reply

Your email address will not be published. Required fields are marked *