To send WordPress email through SendGrid, install and activate the official SendGrid plugin, choose API or SMTP delivery, authenticate a verified sender or domain, enter the required credentials, and send a test message. API mode uses a SendGrid API key over HTTPS; SMTP mode uses smtp.sendgrid.net, the literal username apikey, that API key as the password, and a supported port such as 587.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
How WordPress email reaches SendGrid
WordPress normally hands outgoing messages to its wp_mail() function. Password resets, contact-form notifications, administrator alerts, store messages and other system email all use that path. A SendGrid integration replaces the normal delivery route so those messages are submitted to SendGrid rather than relying on the web server’s local mail configuration.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
The official SendGrid WordPress plugin supports two routes:
- API: WordPress sends an authenticated HTTPS request to SendGrid with an API key.
- SMTP: WordPress connects to SendGrid’s SMTP relay and authenticates with a username and API-key password.
Both routes can deliver WordPress email, but they expose different settings and failure points. API mode is generally the simpler choice when the plugin and your other mail tools support it directly. SMTP is useful when an existing mail stack or another plugin specifically requires SMTP host, port, TLS and username fields.
#1 Best Overall
What you need before configuring the plugin
A SendGrid account and an API key
Create a SendGrid account, then create an API key for the WordPress connection. API keys can be scoped and revoked. Give the key only the permissions required by the integration, normally the ability to send mail, rather than broad account access. Record the key when it is created; do not put it in a theme file, a public repository, a screenshot or an unsecured support ticket.
Plan one key for this site or environment rather than sharing a personal administrator credential. A separate key makes it possible to revoke WordPress access without disrupting unrelated applications. If you operate staging and production separately, keep their credentials separate as well. Never assume that hiding a key in a field labeled “password” protects it from source control, backups or logs.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →A sender identity
SendGrid must recognize the address used in the message’s From field. You can verify a single sender identity, or authenticate the domain that sends your mail. Domain authentication is preferable for a production website because it verifies domain ownership, authorizes the domain to send, establishes the sender identity and helps preserve message integrity.
Choose the sender before you configure WordPress. Decide which mailbox should receive replies and use the message’s Reply-To field for that destination when your form or ecommerce plugin supports it. The visible From address should remain an address you have verified in SendGrid; changing it later to an unrelated address is a common reason for rejection.
Access to DNS
Domain authentication provides DNS records that must be published at your domain host. Copy the record names, types and values exactly as SendGrid displays them. DNS changes can take time to appear, and SendGrid will not treat the domain as authenticated until its checks pass.
Make the DNS change at the provider that is authoritative for the domain, not necessarily the company that hosts WordPress. Preserve punctuation, host names and values exactly, and avoid adding a second conflicting record. Return to SendGrid after the records are published and run its verification check again.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWordPress administrator access
You need permission to install a plugin and change its mail settings. If the site is managed by an agency or hosting provider, arrange access to both the WordPress dashboard and the DNS provider before starting.
A controlled test destination
Have an address you control before saving the configuration. A mailbox at a different provider from your website is useful for checking delivery and spam placement independently of the sending domain. Test addresses should not be real customers or members who could receive accidental notifications.
Install the SendGrid WordPress plugin
- Sign in to the WordPress administrator dashboard.
- Open Plugins and select Add New.
- Search for SendGrid Plugin.
- Select the official plugin, choose Install Now, and then select Activate.
The plugin replaces WordPress’s default wp_mail() path with either its SendGrid API integration or its SMTP integration. Before configuring it, check whether another mail plugin declares or replaces wp_mail(). The SendGrid plugin documentation identifies that as a conflict: the site can appear configured while another component still controls delivery.
Do not install multiple mail transports merely to compare them on a live site. If another SMTP, transactional-mail or hosting-mail plugin is active, document its settings first and decide which integration should remain authoritative. A conflict can make a successful test in one interface misleading because a different component handled the actual message.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #2
Verify the sender or domain in SendGrid
Single-sender verification
A single sender identity is suitable for a controlled test or a small site that always sends from one address. Complete the verification message sent to that address before using it in WordPress. If the address is not verified, SendGrid can reject the message even when the API key or SMTP credentials are correct.
Use a sender mailbox that your organization controls and can continue monitoring. Verification of one address does not automatically authorize every other address at the same domain. If the site may send from several addresses, domain authentication avoids repeatedly verifying individual senders.
Domain authentication
- Open SendGrid’s domain-authentication setup.
- Enter the domain that should appear in the site’s sender address.
- Copy the DNS records SendGrid supplies.
- Create those records with the domain’s DNS provider without changing their host names or values.
- Return to SendGrid and run its verification check.
Use a sender address aligned with the authenticated domain, such as [email protected] when example.com is authenticated. Authentication improves the site’s sending identity, but it does not guarantee that every receiving mailbox will place every message in the inbox. Filtering also depends on the receiving provider, the message and the recipient’s mailbox rules.
Complete authentication before troubleshooting WordPress credentials. Otherwise, a sender rejection can look like an API or SMTP failure. Once SendGrid reports the domain as authenticated, keep the DNS records in place; removing or altering them can invalidate the verification later.
Configure WordPress with the SendGrid API
API mode makes an HTTPS request authenticated by the API key. It avoids SMTP host and port settings and is usually the most direct configuration when the official plugin is handling delivery.
- Open the SendGrid plugin’s settings in the WordPress dashboard.
- Select the API integration option.
- Paste the SendGrid API key into the key field.
- Enter the verified sender name in the From Name field.
- Enter the verified sender address in the From Email field.
- Save the settings.
Use the key created for this site and confirm that its scope includes permission to send mail. A key with unrelated account permissions is unnecessary exposure, while a key that lacks Mail Send permission produces an authentication or authorization error even when it was pasted correctly.
Do not paste the key into a theme template or commit it to source control. Where your hosting arrangement supports protected server configuration, keep secrets there. The legacy plugin documentation also describes constants that can be placed in wp-config.php:
define('SENDGRID_API_KEY', 'your-api-key');
define('SENDGRID_FROM_NAME', 'Your Site Name');
define('SENDGRID_FROM_EMAIL', '[email protected]');
Replace the example values with your own credentials and verified sender. Protect wp-config.php as you would any other server secret. If a key has been exposed, revoke it in SendGrid and create a replacement with limited permissions.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →If the plugin offers both dashboard fields and constants, use one clearly documented source of truth. After saving, reopen the settings and confirm that the intended sender and integration mode are still selected. Do not paste a complete API response, key or configuration export into a public support forum when asking for help.
Configure WordPress with SendGrid SMTP
SMTP mode creates a relay connection instead of sending an API request. Enter every value exactly; a single wrong field can produce an authentication or connection error.
| Setting | Value | Important qualification |
|---|---|---|
| SMTP host | smtp.sendgrid.net |
Use the SendGrid relay host exactly. |
| Username | apikey |
This is the literal word apikey, not your API key. |
| Password | Your SendGrid API key | The key must have permission to send mail. |
| Port | 587 |
A commonly supported submission port. |
| Other listed ports | 25 or 2525 |
Use only when your host and network permit them. |
- Choose the plugin’s SMTP integration option.
- Set the host to
smtp.sendgrid.net. - Set the username to the exact string
apikey. - Set the password to the generated SendGrid API key.
- Set the port to 587 and enable the TLS or secure-connection option required by the plugin.
- Save the configuration.
Some versions of the legacy WordPress plugin require Swift Mailer for their SMTP path. If the SMTP option reports that dependency as missing, install or enable the required component only through the plugin’s documented, compatible method. Do not assume an API-mode installation supplies every SMTP dependency.
The most frequent SMTP mistake is entering the API key in both credential fields. SendGrid’s SMTP requirement is explicit: the username is the literal string apikey, while the generated key is the password. Copy the host without an https:// prefix, and do not add spaces around the key.
Port choice is a hosting issue as much as a SendGrid issue. Start with 587. If the connection is blocked, 2525 is another listed option when the host permits it. Port 25 may be restricted by a provider’s anti-abuse policy, so a timeout on that port does not prove that the credentials are wrong.
API or SMTP: which should you choose?
| Decision point | API | SMTP |
|---|---|---|
| Connection | HTTPS/API request authenticated by an API key | SMTP relay authenticated with username apikey and the API key as password |
| Typical setup | Select API mode, enter the key and sender fields | Enter host, port, TLS settings and credentials; some legacy plugin versions require Swift Mailer |
| Best fit | A site whose integration supports SendGrid API directly | An existing mail stack or plugin that requires SMTP fields |
| Main checks | Key scope, sender verification and HTTP/API errors | Host, port, TLS, literal username, key formatting and blocked outbound ports |
| Credential handling | One API key in the integration | The same key is entered as the SMTP password, with an additional fixed username |
| Troubleshooting visibility | Inspect API response and plugin error output | Separate authentication, TLS, port and relay-connection errors |
Choose API mode when you want the shortest supported configuration and clear API responses. Choose SMTP when another component cannot use an API or when your existing mail architecture is built around SMTP fields. Neither option removes the need for sender verification or secure key handling.
There is no need to configure both routes for normal operation. Running two competing transports can make failures difficult to reproduce and can cause administrators to test one path while production mail uses another. Select one route, record its settings, and keep the alternative only as a documented fallback.
Send and inspect a test email
Do not wait for a password-reset request or customer order to reveal a configuration problem. The plugin exposes a test-email form after valid credentials are entered.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Open the plugin’s test-email screen.
- Send a message to an address you control, preferably at a different mailbox provider from the website’s domain.
- Confirm whether the message arrives and whether it is in the inbox or spam folder.
- Inspect the visible From and Reply-To values.
- Review the plugin’s error output and the corresponding SendGrid activity or event information.
- Repeat the test after correcting any sender, authentication, DNS or connection error.
A successful API response or SMTP handoff means SendGrid accepted the message for processing; it is not a promise of inbox placement. Check the actual recipient mailbox, its spam folder and any filtering rules before treating the setup as complete.
Test more than the plugin’s built-in form when the site is important. Trigger a WordPress password reset, submit a contact form and, if applicable, create a controlled order or membership event. These tests confirm that real WordPress hooks use the configured transport and that form-specific From or Reply-To settings do not override the verified identity.
Record the result, including the time, recipient provider, visible sender and any error text. That small record helps distinguish a repeatable configuration problem from a single recipient-side filtering decision.
Use SendGrid for WordPress’s important messages
Password resets and administrator notices
Test a password reset and an administrator notification after the basic test succeeds. These messages verify that WordPress-generated mail, rather than only the plugin’s test form, is using the configured route.
Rank #4
Use a test administrator account or a controlled address, and verify that the reset link arrives intact and that the message’s From address is still authenticated. Do not test by repeatedly requesting resets for a real user’s account.
Forms and membership workflows
Submit each important form with a controlled address. Check both the notification sent to the site owner and any confirmation sent to the visitor. If a form plugin has its own SMTP or API settings, make sure it is not bypassing the WordPress mail path you just configured.
Some form tools let an administrator choose an arbitrary visitor address as the From value. Keep the authenticated site address in From and place the visitor’s address in Reply-To when possible. This preserves a consistent sending identity while still allowing a direct reply.
Ecommerce and scheduled messages
Test order, account and scheduled notifications in a staging or low-risk workflow before relying on them in production. Confirm that the sender address remains the authenticated address and that replies go to the intended Reply-To address.
Scheduled jobs may run under a different process or hosting environment from an administrator’s browser test. After a plugin, hosting or DNS change, repeat at least one scheduled-message test and inspect the resulting event in SendGrid.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot SendGrid email that does not arrive
Authentication failure
- Regenerate the API key if it may be expired, mistyped or exposed.
- Confirm that the key’s scope includes permission to send mail.
- In SMTP mode, verify that the username is exactly
apikey; entering the API key as the username is incorrect. - Paste the password again without surrounding spaces or quotation marks.
- Check that the WordPress configuration is using the current key rather than an old constant or cached setting.
Sender rejected or unverified
- Confirm that the address in the plugin’s From Email field is the verified sender.
- Complete single-sender verification or domain authentication.
- Publish every DNS record supplied for domain authentication and rerun SendGrid’s verification check.
- Align the From domain with the authenticated domain instead of using an unrelated free-mail address.
- Check form and ecommerce plugins for a second From value that overrides the global WordPress setting.
SMTP connection timeout
- Try port 587 first, then 2525 if the host supports it.
- Use port 25 only when your hosting provider permits outbound traffic on that port; many hosts restrict it to reduce abuse.
- Check the plugin’s TLS setting and confirm that the server can make outbound SMTP connections.
- Ask the hosting provider whether a firewall or security policy is blocking
smtp.sendgrid.net.
A timeout is different from a rejected sender. First establish that the server can reach the relay on the selected port; then investigate credentials and sender verification. Changing several fields at once makes it harder to identify which correction worked.
The plugin is configured, but WordPress still uses another mail path
Look for another plugin or must-use extension that declares wp_mail() or installs its own mail transport. Disable competing mail integrations one at a time in a maintenance window, then send a fresh test. The official SendGrid plugin specifically warns that another component declaring wp_mail() can prevent its integration from working.
Messages arrive in spam
Verify domain authentication and make sure the From address aligns with that domain. Inspect the receiving mailbox’s filtering and the message’s headers. A successful SendGrid API response does not guarantee inbox placement, because the receiving provider makes the final filtering decision.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Compare results across more than one controlled mailbox provider before changing the integration. If delivery succeeds but placement differs, the cause may be recipient-side filtering rather than a failed WordPress connection. Keep the From identity consistent and avoid switching addresses while diagnosing the problem.
A key has been exposed
- Revoke the exposed key in SendGrid immediately.
- Create a replacement key with the narrowest required permissions.
- Update the WordPress API or SMTP password.
- Search deployment files, logs and repositories for the old value and remove copies where possible.
- Send a new test message and monitor the sending activity.
Also review who had access to the exposed value and whether the key was copied into a backup, staging site or support transcript. Revocation stops future use of that key; it does not erase copies already stored elsewhere.
Operational checks after launch
- Keep the sender address and authenticated domain documented for every administrator.
- Review SendGrid events when a message is rejected, deferred or marked as bounced.
- Rotate keys when staff access changes or a credential may have been disclosed.
- Retest password resets, forms and other critical notifications after changing plugins, hosting, DNS or mail settings.
- Keep only one authoritative mail transport unless a documented exception requires another plugin.
- Record whether the site uses API or SMTP, the selected SMTP port if applicable, and where the protected credential is stored.
- Remove old credentials from decommissioned staging sites and copied configuration files.
With those controls in place, WordPress can submit routine site mail through SendGrid using either the API or SMTP route, while the test and troubleshooting steps provide a way to distinguish credential, sender, DNS, transport and recipient-filtering problems.
Frequently Asked Questions
How do I connect SendGrid to WordPress?
Install and activate the official SendGrid Plugin from Plugins → Add New, create a SendGrid API key, verify a sender or authenticate your domain, select API or SMTP mode, enter the matching credentials, save the settings and send a test email.
Should I use the SendGrid API or SMTP with WordPress?
Use API mode when the plugin supports it directly and you want a short HTTPS-based setup. Use SMTP when another plugin or existing mail stack requires an SMTP host, port, TLS and credential fields. Both still require sender verification and secure key handling.
What is the SendGrid SMTP username?
The username must be the literal string apikey. The SendGrid API key goes in the password field. Do not enter the API key as the username.
Which SMTP host and port should WordPress use?
Use smtp.sendgrid.net. Port 587 is the usual starting point; SendGrid also lists 25 and 2525, subject to your hosting provider and network allowing outbound connections.
Why does SendGrid reject my WordPress sender?
The From address may not be verified, the domain may not be authenticated, or a form plugin may be overriding the configured sender. Verify the address or publish all DNS records supplied for domain authentication, then align the From address with that domain.
Why does the test email go to spam?
Authentication and a successful API response do not guarantee inbox placement. Confirm domain authentication and From alignment, then inspect the receiving mailbox’s spam settings and message headers. The recipient provider makes the final filtering decision.
Can I store the SendGrid key in wp-config.php?
The legacy plugin documentation describes protected constants such as SENDGRID_API_KEY, SENDGRID_FROM_NAME and SENDGRID_FROM_EMAIL in wp-config.php. Protect that file, keep it out of public repositories and use a narrowly scoped key.
What should I do if my SendGrid API key is exposed?
Revoke it in SendGrid, create a replacement with the narrowest required permissions, update the WordPress API or SMTP password, remove exposed copies where possible and send a fresh test message.
Why is the SendGrid plugin configured but WordPress still sends another way?
Another plugin or must-use extension may declare wp_mail() or install its own transport. Check for competing mail integrations and disable them one at a time in a maintenance window before testing again.
Free tools Windows power users keep installed
One-click scans. No signup required.
The Bottom Line
Install the official SendGrid plugin, authenticate the sender or domain, then choose one delivery route: API mode with a scoped key, or SMTP at smtp.sendgrid.net using username apikey, the key as password and port 587. Test real WordPress notifications, not just the plugin form, and treat sender verification, key protection and recipient-side filtering as ongoing responsibilities.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




