How to configure SMTP email on Cloudways
Cloudways provides a dedicated SMTP section in the server dashboard where you configure third-party providers like SendGrid. However, WordPress doesn't automatically use server-level SMTP, so you must install and configure a plugin like WP Mail SMTP to actually send emails from your application.
Prerequisites
- Active Cloudways account with server admin permissions
- SMTP credentials from provider (SendGrid, Mailgun, Amazon SES)
- WordPress admin access if configuring for WordPress
- SSH access to server enabled in Cloudways dashboard
- WP Mail SMTP or similar plugin installed
Step-by-Step Instructions
Log in to Cloudways Dashboard
Navigate to your Cloudways account and sign in. From the top menu, select your Server (not an individual application). This ensures you're configuring SMTP at the server level, which applies to all applications on that server.
Navigate to SMTP Settings
In the server details page, locate the left sidebar and scroll to the Server Management section. Click on SMTP, which is listed alongside other server-level settings like Monitoring and Cron Jobs.
Select Your SMTP Provider
From the dropdown menu, choose your SMTP provider. Cloudways offers pre-configured options including SendGrid, Mailgun, Amazon SES, and SMTP Generic for custom providers. Select the provider that matches your email service account.
Enter SMTP Credentials
Input your SMTP credentials in the provided fields. For SendGrid, use smtp.sendgrid.net as the host, 587 as the port, apikey as the username, and your SendGrid API key as the password. Set encryption to TLS. For other providers, consult their documentation for the correct host, port, and authentication method. Specify a From Email address (e.g., noreply@yourdomain.com) that will appear as the sender.
Test SMTP Configuration
Click the Test SMTP Configuration button. Enter a test recipient email address and send a test message. Cloudways will confirm whether the server-side SMTP connection works. A successful test indicates your credentials and provider settings are correct at the server level.
Save Changes
Click Save Changes to apply the SMTP configuration server-wide. You may need to restart PHP-FPM for changes to take effect. Navigate to Server > Settings & Packages > PHP-FPM Restart and click restart.
Install WP Mail SMTP Plugin
Log in to your WordPress admin dashboard. Go to Plugins > Add New and search for WP Mail SMTP. Install and activate the plugin. This plugin overrides WordPress's default wp_mail() function to use SMTP instead of PHP mail().
Configure WP Mail SMTP Plugin
In the WordPress admin, navigate to WP Mail SMTP > Settings. Under the Mailer section, select Other SMTP. Enter the same SMTP credentials you configured in Cloudways: host, port, username, password, and encryption type. Enable Force SMTP to ensure WordPress uses SMTP instead of PHP mail().
Test Email from WordPress
In the WP Mail SMTP settings, locate the Test Email section. Enter a test recipient email address and click Send Test Email. If successful, WordPress is now sending emails via your configured SMTP provider. Check the recipient's inbox (including spam folder) to confirm delivery.
Verify Email Delivery and Monitor
Send a test user invitation or password reset from WordPress to confirm emails are being delivered. Monitor your SMTP provider's dashboard (e.g., SendGrid's activity log) to track sent emails and identify any delivery issues. Set up email logs in WP Mail SMTP to track all outgoing messages from WordPress.
Common Issues & Troubleshooting
WordPress emails not sending despite successful Cloudways SMTP test
WordPress doesn't automatically use server-level SMTP. Install and activate WP Mail SMTP plugin, configure it with your SMTP credentials, and enable Force SMTP to override the default PHP mail() function.
Authentication error or 'Invalid credentials' message
Verify your SMTP credentials in both Cloudways and the WordPress plugin match exactly. For SendGrid, ensure you're using an API key (not your account password) and that the username is set to 'apikey'. Check your provider's documentation for correct host and port.
Emails sent but not received or going to spam
Check your SMTP provider's activity log for delivery status. Verify the From Email address is properly configured and matches a verified sender in your provider account. Ensure SPF and DKIM records are configured for your domain to improve deliverability.
Connection timeout or port blocked error
Verify you're using the correct port for your encryption type (587 for TLS, 465 for SSL). Some providers block port 25. Test the connection using SSH: <pre><code>telnet smtp.sendgrid.net 587</code></pre> to confirm the port is accessible.
PHP-FPM needs restart after SMTP configuration changes
Navigate to Cloudways Server > Settings & Packages > PHP-FPM Restart and click the restart button. This ensures PHP processes pick up the new SMTP configuration.