WordPress SMTP: how to configure reliable email for forms, password resets, and WooCommerce
A contact form may display a confirmation message, WooCommerce may record an order, and WordPress may accept a password reset request without the email reaching the recipient. The issue is not always with the website: it may depend on the hosting email system, SMTP credentials, the sender address used, or delivery by the recipient’s provider.
Configuring WordPress SMTP, or an API integration with a transactional email provider, makes the sending workflow easier to control. However, it does not guarantee Inbox delivery: domain authentication with SPF, DKIM, and DMARC, as well as recipient-side filters, remain decisive factors.
First verify the domain with the provider, configure a single global mailer, set a consistent sender address, and then test the website’s real events.
How email sending works in WordPress
From wp_mail() to the provider
WordPress sends many notifications through wp_mail(), a function that uses PHPMailer. By default, delivery is handled by the email system configured on the hosting server. This approach can work, but it often offers limited control and may be affected by the configuration or reputation of shared infrastructure.
An SMTP plugin or API integration normally changes this global workflow. A correct configuration can therefore affect form notifications, user registrations, password resets, admin alerts, and WooCommerce emails. The wp_mail() documentation makes clear that a successful result from the function does not necessarily mean that the recipient received the message.
SMTP, SMTP relay, and email APIs
SMTP is the protocol WordPress can use to authenticate with a mail server and deliver it a message. A transactional email provider acts as a relay: it receives emails from the website, forwards them to recipients, and may provide information about acceptance, bounces, deferrals, and suppressed addresses.
Many providers also offer an email API. Instead of opening an SMTP connection, the plugin communicates with the service over HTTPS using an API key or OAuth. Choose the API when the plugin provides a maintained native integration or when the host blocks outgoing SMTP connections. Generic SMTP is suitable when the provider supplies SMTP credentials and the website does not require a proprietary integration.
For important transactional emails, such as orders and password recovery messages, avoiding PHP’s default sending method alone is often useful when the host does not provide domain authentication, accessible logs, or delivery support.
A successful test does not prove delivery
The chain includes several steps: WordPress generates the email, the mailer attempts to send it, the provider accepts it, and the recipient’s server evaluates it. The message may then be delivered, moved to spam, deferred, or rejected.
A message marked as “sent” by the plugin may therefore only mean that the relay accepted it. To understand what happened afterward, you need the provider’s logs, the headers of any received email, and tests with different mailboxes.
Before configuration: domain, provider, and mailer
Choose the provider based on the type of sending
For forms, orders, and system notifications, consider a provider focused on transactional email, with up-to-date documentation, domain verification, and delivery logs. If you expect regular WooCommerce email volumes, also check its bounce and suppression handling; this information is useful for understanding why a recipient no longer receives messages.
Brevo, Postmark, Amazon SES, Twilio SendGrid, Resend, and MailerSend offer sending options for applications. Hosts, ports, keys, and requirements are not interchangeable: always copy them from the current documentation for the service you choose. For example, Brevo publishes instructions for SMTP integration, while Postmark documents sending via SMTP and its API separately.
Verify the domain and choose the sender
In the provider’s dashboard, add the domain you will use to send emails and publish the required DNS records. The service may require verification records and domain authentication records. Complete this step before connecting WordPress.
Use a sender address that belongs to the verified domain, for example noreply@azienda.it, ordini@azienda.it, or supporto@azienda.it. Avoid using a Gmail, Yahoo, or visitor’s personal address as the technical sender: a mismatch between the website domain, provider, and From field can cause rejections or increase spam risk.
Configure only one global mailer
Install and activate only one plugin responsible for global email sending. Two active SMTP plugins, or multiple components that modify PHPMailer, can override the host, credentials, or sender and produce inconsistent results.
Before testing, disable duplicate SMTP configurations. If a form plugin or WooCommerce extension has its own sending configuration, check whether it uses the global mailer or requires an explicitly documented exception.
How to configure WordPress SMTP step by step
1. Install the plugin and choose the sending method
In your chosen plugin, first look for a native mailer for the selected provider. It generally requires an API key, a setup wizard, or OAuth and reduces the number of SMTP parameters you need to enter.
If no suitable integration exists, use the option often called “Other SMTP,” “Generic SMTP,” or equivalent. Enter only the information provided by the provider: some services distinguish API keys from SMTP keys, while others require regional credentials or specific formats.
2. Enter the host, port, encryption, and credentials
A generic SMTP configuration normally requires the following fields:
- SMTP Host: the hostname specified by the provider;
- Encryption: STARTTLS/TLS or SSL/TLS, according to the service instructions;
- SMTP Port: the port associated with the selected encryption method;
- SMTP Authentication: enable this when the provider requires authenticated access;
- Username: the required SMTP username;
- Password: the SMTP password, token, or dedicated SMTP key.
Port 587 with STARTTLS/TLS is a common combination, but it is not universal. Some providers use port 465 for implicit TLS; port 25 is often filtered or limited by hosting providers for anti-spam reasons.
Follow the host, port, and encryption combination specified by the provider. Do not disable TLS to work around a connection error: instead, check the port, firewall, certificate, and hosting restrictions.
3. Set From, From Name, and Reply-To
The From field identifies the technical sender of the email and must use the verified domain. A consistent configuration could be:
From: Sito Azienda <noreply@azienda.it>
Reply-To: commerciale@azienda.it
In contact forms, the address entered by the visitor must not be placed in the From field. Use it in the Reply-To field instead:
From: Sito Azienda <noreply@azienda.it>
Reply-To: email-del-visitatore@example.com
To: commerciale@azienda.it
This allows the recipient to reply directly to the visitor without making the message appear to have been sent from the visitor’s domain. In form plugins, make sure Reply-To uses the form’s email field according to the plugin’s required syntax; for example, WPForms documents how to configure email notifications.
Also check WooCommerce settings: they may define their own sender, name, and recipients. The option that globally forces the From Email and From Name values can standardize notifications, but it should be enabled only after confirming that it does not alter emails that are already configured correctly.
4. Protect keys and credentials
Use a key dedicated to the website, with the minimum permissions required, and enable multi-factor authentication on the provider account. If a key appears in a screenshot, public ticket, or repository, revoke and replace it immediately.
Some plugins allow credentials to be defined through constants in wp-config.php. This can be useful in deployment processes, but it does not replace server protection. Do not use personal passwords as SMTP credentials when the provider offers dedicated keys or OAuth.
Testing forms, password resets, and WooCommerce
The built-in email test in the plugin is necessary, but it is not enough. After running it, check the provider dashboard to see whether the message was accepted, then test the events that actually matter:
- send a message using the plugin’s test feature;
- check whether the provider relay accepted it and review its subsequent status;
- check the recipient mailbox’s spam folder and full headers;
- submit a real contact form;
- request a WordPress password reset;
- create a WooCommerce test order and move it to the status that triggers the expected notification.
Test with at least two recipients using different providers, such as Gmail and Outlook. A single successful delivery proves that the workflow works in that case, not that every provider will handle the message in the same way.
Check WooCommerce emails
Open WooCommerce → Settings → Emails. For each notification, check whether it is enabled, which recipients it uses, and which event or order status triggers it. From this screen, you can also review the general sender name and address settings.
Before attributing a sending failure to SMTP, check that WooCommerce generated the expected notification. The documentation on WooCommerce email settings explains which notifications are available and how they are configured.
Not all installations have a dedicated WooCommerce log for transactional emails. If an extension or integration produces logs, you can look for them in WooCommerce → Status → Logs, but the source name varies. For delivery, rely primarily on the mailer plugin log and the events recorded by the SMTP or API provider.
If WordPress emails do not arrive: a layered diagnostic process
1. Check that the event generated an email
First check the application event: whether the WooCommerce notification is enabled, the recipient is correct, the expected order status is set, and whether conditions added by automations or extensions apply. For a form, check the notification configuration in the plugin being used.
The absence of an event in the provider dashboard does not, by itself, prove that the problem is at the application level: an SMTP error may interrupt the workflow before the relay receives the message.
2. Check mailer and WordPress errors
Review the SMTP plugin log, if available, as well as WordPress or PHP debugging information. WordPress also provides the wp_mail_failed hook, which developers can use to log errors returned by wp_mail().
“Could not connect to SMTP host” error
Check the host, port, and encryption settings: they must match the provider’s documentation. Then check for firewalls, invalid TLS certificates, and blocks on outgoing SMTP connections imposed by the host. Ask hosting support whether the required port is filtered and, if the provider and plugin support it, consider an API integration without reducing the security level.
Error 535 or failed authentication
Error 535 often indicates that the credentials were not accepted. Common causes include an incorrect username, an API key entered instead of an SMTP key, a revoked key, an incorrect password format, an outdated IP allowlist, or OAuth required by the provider. Generate a dedicated SMTP key again and review the service instructions.
3. Check acceptance and delivery
If the provider received the message, look for statuses such as accepted, delivered, bounced, deferred, and suppressed, according to the service’s terminology. A bounce, deferral, or suppression requires different action. If the message is marked as delivered but lands in spam, review the headers, sender domain, and domain authentication.
Sender reputation, recipient mailbox policies, and message content can affect the outcome. Google publishes specific requirements for senders delivering to Gmail, with stricter conditions for bulk sending: review the Gmail sender guidelines before using high-volume sending as a reference for all websites.
The displayed sender differs from the configured one
Compare the SMTP plugin configuration with those of WooCommerce, the form plugin, and the provider. Some providers accept only verified addresses or domains and may rewrite or reject unauthorized senders. Define one consistent global sender and keep exceptions only when necessary.
SMTP is not enough for deliverability: check the domain
SMTP authenticates WordPress with the relay. SPF, DKIM, and DMARC, on the other hand, help recipients verify that the sender domain is authorized and that the message has not been altered. These are separate and complementary layers; WooCommerce summarizes the role of email authentication in message delivery.
If WordPress generates emails and the provider accepts them, but the messages still land in spam or are rejected, check the DNS records required by the provider and the authentication results in the headers of the received message.
Finally, limit access to email logs to users who genuinely need it and review the retention period set in the plugin and with the provider. Logs may contain customer addresses, form content, and password reset links; avoid retaining extensive production logs without a specific operational need.











