Having problem with your WordPress site not sending emails? over 6k websites use Mail250 platform to fix their email delivery issues.
WordPress users face this chronic email delivery problem due to the fact that by default WordPress website uses wp_mail() which internally uses PHP’s mail() function, which uses server’s localhost configuration (on which website is hosted) to send emails. The default configuration won’t work as most of the shared hosting providers blocks outgoing SMTP ports 25 to protect their infrastructure from spam. This plugin fixes this problem by using Mail250 SMTP services instead of your hosting provider’s server settings.
Mail250 is an AI-Driven Bulk Email Marketing Service
The Mail250 plugin uses SMTP integration to send outgoing emails from your WordPress installation. It replaces the wp_mail function included with WordPress.
To have the mail250 plugin running after you have activated it, go to the plugin’s settings page and set the mail250 credentials.
How to use
wp_mail() function so all email sends from WordPress should go through Mail250.
You can send emails using the following function:
wp_mail($to, $subject, $message, $headers = '', $attachments = array())
$to– Array or comma-separated list of email addresses to send message.
$subject– Your email subject
$message– Your email body (HTML)
$headers– Array or “\n” separated list of additional headers. Optional.
$attachments– Array or “\n”/”,” separated list of files to attach. Optional.
The wp_mail function is sending text emails as default. If you want to send an email with HTML content you have to set the content type to ‘text/html’ running
add_filter('wp_mail_content_type', 'set_html_content_type'); function before to
After wp_mail function you need to run the
remove_filter('wp_mail_content_type', 'set_html_content_type'); to remove the ‘text/html’ filter to avoid conflicts –https://core.trac.wordpress.org/ticket/23578
Example about how to send an HTML email using different headers:
$subject = 'Test Email via WP Mail SMTP plugin'; $message = 'Body of the test email sent using WP Mail STMP WordPress plugin'; $to = 'firstname.lastname@example.org, Recipient Name <email@example.com>'; or $to = array('firstname.lastname@example.org', 'Recipient Name <email@example.com>'); $headers = array(); $headers = 'From: Sender <firstname.lastname@example.org>'; $headers = 'X-Your-Custom-Header: YourCustomeHeaderValue'; $attachments = array('/tmp/img1.jpg', '/tmp/img2.jpg'); add_filter('wp_mail_content_type', 'set_html_content_type'); $mail = wp_mail($to, $subject, $message, $headers, $attachments); remove_filter('wp_mail_content_type', 'set_html_content_type');
Data & Privacy
- PHP version >= 5.3.0
To upload the Mail250 Plugin .ZIP file:
- Upload the WordPress Mail250 Plugin to the /wp-contents/plugins/ folder.
- Activate the plugin from the “Plugins” menu in WordPress.
- Create a Mail250 account at http://www.mail250.com/
- Once the account is created. Login to your Mail250 account and navigate to “Home” -> “SMTP Details” to get your SMTP credentials
Contributors & Developers
“Free WP Mail SMTP (Official – 2019)” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- Mail250 WordPress SMTP Plugin released