
If you want to configure the Gmail SMTP server to send email, you need to use Gmail’s SMTP settings along with authentication. For personal Gmail accounts, the SMTP server is smtp.gmail.com, the SMTP port is 587 (TLS) or 465 (SSL), and you must authenticate with your Gmail address and either an App Password (recommended) or OAuth 2.0. Once configured correctly, you can securely send emails from websites, applications, WordPress, Outlook, PHP scripts, and other email clients using Gmail’s reliable SMTP service.
Learn how to configure the Gmail SMTP server to send email with this step-by-step guide. Discover Gmail SMTP settings, App Password setup, ports 587 & 465, troubleshooting tips, and secure email configuration for WordPress, PHP, Laravel, and Outlook.
What Is Gmail SMTP?
Gmail SMTP (Simple Mail Transfer Protocol) is Google’s outgoing mail server that allows users and applications to send emails using Gmail accounts. Instead of relying on your web hosting server’s mail function, Gmail SMTP authenticates every email before sending it, improving security and deliverability.
Developers, businesses, and website owners commonly use Gmail SMTP for:
- Contact forms
- WordPress websites
- Business applications
- CRM software
- Email marketing tools (within Gmail sending limits)
- PHP mail applications
- Desktop email clients
Because Gmail uses Google’s infrastructure, emails are generally trusted by receiving mail servers.
Gmail SMTP Server Settings
Use the following settings when configuring Gmail SMTP.
| Setting | Value |
|---|---|
| SMTP Server | smtp.gmail.com |
| Port (TLS) | 587 |
| Port (SSL) | 465 |
| Authentication | Yes |
| Username | Your full Gmail address |
| Password | Gmail App Password |
| Encryption | TLS or SSL |
These settings work with most applications and email clients.
Requirements Before Configuring Gmail SMTP
Before you begin, make sure you have:
- A Gmail account
- Two-Step Verification enabled
- A generated Gmail App Password
- Internet connection
- Email client or application
Google no longer allows less secure apps access. App Passwords or OAuth authentication are now required.
How to Create a Gmail App Password
App Passwords provide a secure way for third-party applications to connect to Gmail without exposing your main account password.
Step 1
Sign in to your Google Account.
Step 2
Open Security.
Step 3
Enable 2-Step Verification if it isn’t already enabled.
Step 4
Open App Passwords.
Step 5
Select:
- App
- Device
or choose Other (Custom Name).
Example:
Website SMTP
Step 6
Click Generate.
Google will provide a 16-character App Password.
Use this password instead of your Gmail password when configuring SMTP.
Configure Gmail SMTP in WordPress
Many WordPress websites experience email delivery issues because the default PHP mail function is unreliable.
Instead, configure Gmail SMTP using an SMTP plugin.
Typical settings include:
SMTP Host:
smtp.gmail.com
SMTP Port:
587
Encryption:
TLS
Authentication:
Enabled
Username:
Password:
Your Gmail App Password
After saving the settings, send a test email to verify everything works correctly.
Configure Gmail SMTP in Outlook
To configure Outlook:
- Open Account Settings.
- Choose Manual Configuration.
- Select SMTP.
- Enter:
Server:
smtp.gmail.com
Port:
587
Encryption:
STARTTLS
Authentication:
Yes
Username:
Full Gmail Address
Password:
App Password
Save the configuration and test sending an email.
Configure Gmail SMTP in PHP
PHP developers often use Gmail SMTP with libraries such as PHPMailer.
Typical configuration includes:
- SMTP Host
- Authentication enabled
- TLS encryption
- Port 587
- Gmail username
- App Password
Using SMTP instead of PHP mail() greatly improves email reliability.
Configure Gmail SMTP in Laravel
Laravel includes built-in SMTP support.
Update your .env file with:
MAIL_MAILER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=YourAppPassword MAIL_ENCRYPTION=tls [email protected] MAIL_FROM_NAME="Your Website"
After clearing configuration cache, Laravel will send emails using Gmail SMTP.
Configure Gmail SMTP in cPanel Websites
If your website is hosted on cPanel, many contact forms support external SMTP.
Simply enter:
- SMTP Host
- Port
- Encryption
- Gmail address
- App Password
This method usually works better than the default mail server provided by the hosting provider.
Gmail SMTP Sending Limits
Although Gmail SMTP is reliable, Google enforces sending limits to prevent spam.
Approximate daily limits include:
- Personal Gmail: around 500 emails per day
- Google Workspace: up to 2,000 emails every day (depending on account type)
Exceeding these limits may temporarily suspend email sending.
For businesses that send large volumes of email, a dedicated SMTP provider is usually a better option.
Common Gmail SMTP Errors
Authentication Failed
Cause:
Incorrect username or App Password.
Solution:
Generate a new App Password and verify your Gmail address.
Could Not Connect to SMTP Host
Cause:
Wrong server or blocked firewall.
Solution:
Verify:
smtp.gmail.com
and use the correct port.
SMTP Timeout
Cause:
Slow internet or blocked ports.
Solution:
Make sure the firewall allows outbound SMTP connections.
Username and Password Not Accepted
Cause:
Using your Gmail login password instead of an App Password.
Solution:
Always use the generated App Password.
Gmail SMTP Security Best Practices
Follow these recommendations for secure email sending:
- Enable Two-Step Verification.
- Use App Passwords instead of the main password.
- Never hardcode SMTP credentials into public code repositories.
- Rotate credentials if you suspect unauthorized access.
- Restrict access to configuration files.
- Monitor your Google account for unusual login activity.
- Use TLS encryption whenever possible.
These practices help protect your Gmail account and improve email security.
Advantages of Gmail SMTP
There are many reasons why Gmail SMTP remains popular:
- Free for personal use
- High reliability
- Strong security
- Easy integration
- Works with WordPress
- Supports desktop and mobile email clients
- Trusted Google infrastructure
- Secure authentication
- TLS and SSL encryption
- Excellent documentation
For small websites and personal projects, Gmail SMTP is often one of the easiest email solutions available.
When Should You Use Gmail SMTP?
Gmail SMTP is ideal for:
- Personal websites
- Portfolio sites
- Blogs
- Contact forms
- Small business websites
- Internal business tools
- Development and testing
Small eCommerce stores with moderate email volumes
However, if your website sends thousands of emails daily, consider a dedicated SMTP provider that offers higher sending limits, advanced analytics, and better scalability.
Conclusion
Configure Gmail SMTP server to send email is a straightforward way to improve email reliability and security. By using smtp.gmail.com, enabling Two-Step Verification, generating an App Password, and applying the correct SMTP settings, you can successfully send emails from WordPress, PHP applications, Laravel projects, Outlook, and cPanel-hosted websites.