How to send email from WordPress using SMTP (WP Mail SMTP plugin)
Contact form messages not arriving? Order emails from WooCommerce going to spam? By default WordPress sends mail with the PHP mail function, which has no login and is often treated as suspicious. This guide shows you how to send email from WordPress via SMTP with the WP Mail SMTP plugin, so your site emails are authenticated and delivered.
Before you start
- Create a mailbox for the site, for example
noreply@yourdomain.comorinfo@yourdomain.com(see How to create an email account). - Make sure SPF and DKIM are set for your domain (see Why does my email go to spam?).
- Have the mailbox password ready.
Step 1: Install the plugin
- In WordPress, go to Plugins then Add New.
- Search for WP Mail SMTP, install it and activate it.
- Open the plugin settings from the WordPress menu (you can skip the setup wizard and configure it manually).
Step 2: Set the sender
- From Email: enter the mailbox you created. It should be on your own domain.
- Turn on the option to force this From Email so all plugins use it.
- From Name: your company or site name.
Step 3: Choose the mailer and enter SMTP details
If your email is hosted with EgWeb (cPanel email), choose Other SMTP and fill in:
| Field | Value |
|---|---|
| SMTP Host | mail.yourdomain.com (or the host shown in cPanel Connect Devices) |
| Encryption / Port | SSL with port 465, or TLS with port 587 |
| Authentication | On |
| SMTP Username | The full email address |
| SMTP Password | The mailbox password |
If your domain email is on Google Workspace or Zoho Mail, use the matching mailer in the plugin, or Other SMTP with that provider's SMTP host and an app password if the account uses two-step verification.
Step 4: Send a test email
- Open the plugin's Tools page and the Email Test tab.
- Send a test to an address you can check, such as a Gmail address.
- If it fails, the plugin shows a debug message. Read it before changing settings.
Common problems
- "Could not authenticate": wrong username or password. The username is the full address.
- Connection timed out: wrong port or encryption pair. Try 465/SSL, then 587/TLS.
- Emails still go to spam: check that the From Email domain matches your site domain and that SPF and DKIM pass.
- Form plugin uses another sender: make sure "force From Email" is on, or set the same address in the form's notification settings.
Frequently asked questions
Do I need SMTP if my site is hosted on cPanel?
WordPress can send without it, but SMTP gives better delivery and lets you see clear errors. It is strongly recommended for stores and contact forms.
Can I use a free Gmail account?
It is better to use an address on your own domain. Mail "from" your domain sent through a free account often fails authentication checks.
Is the plugin free?
WP Mail SMTP has a free version that supports Other SMTP; paid versions add extra features such as email logs.