Easily send email from your WordPress site through Mailgun using the HTTP API or SMTP.
Mailgun is the email automation engine trusted by over 10,000 website and application developers for sending, receiving and tracking emails. By taking advantage of Mailgun’s powerful email APIs, developers can spend more time building awesome websites and less time fighting with email servers. Mailgun supports all of the most popular languages including PHP, Ruby, Python, C# and Java.
One particularly useful feature of this plugin is that it provides you with a way to send email when the server you are on does not support SMTP or where outbound SMTP is restricted since the plug-in uses the Mailgun HTTP API for sending email by default. All you need to use the plugin is a Mailgun account. Mailgun has a free account that lets you send up to 200 emails per day, which is great for testing. Paid subscriptions are available for increased limits.
The latest version of this plugin now supports regions. Select either U.S./North America or Europe to choose the API endpoint from which you will send email.
The current version of this plugin only handles sending emails, tracking and tagging and list subscription.
mailgun
folder to the /wp-content/plugins/
directory or install directly through the plugin installerSettings -> Mailgun
and configure the plugin with your account detailsYour web server may not allow outbound HTTP connections. Set Use HTTP API
to “No”, and fill out the configuration options to SMTP and test again.
Your web server may not allow outbound SMTP connections on port 465 for secure connections or 587 for unsecured connections. Try changing Use Secure SMTP
to “No” or “Yes” depending on your current configuration and testing again. If both fail, try setting Use HTTP API
to “Yes” and testing again.
If you have to use SMTP and something is still going horribly wrong, enable debug mode in WordPress and also add the MG_DEBUG_SMTP
constant to your wp-config.php
, like so:
define( 'MG_DEBUG_SMTP', true );
Yes, using the following constants that can be placed in wp-config.php:
MAILGUN_REGION Type: string Choices: 'us' or 'eu' ex. define('MAILGUN_REGION', 'us'); MAILGUN_USEAPI Type: boolean Choices: '0' or '1' (0 = false/no) MAILGUN_APIKEY Type: string MAILGUN_DOMAIN Type: string MAILGUN_USERNAME Type: string MAILGUN_PASSWORD Type: string MAILGUN_SECURE Type: boolean Choices: '0' or '1' (0 = false/no) MAILGUN_SECTYPE Type: string Choices: 'ssl' or 'tls' MAILGUN_FROM_NAME Type: string MAILGUN_FROM_ADDRESS Type: string MAILGUN_TRACK_CLICKS Type: string Choices: 'yes' or 'no' MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no'
What hooks are available for use with other plugins?
mg_use_recipient_vars_syntax
Mutates messages to use recipient variables syntax – see
https://documentation.mailgun.com/user_manual.html#batch-sending for more info.
Should accept a list of To
addresses.
Should only return true
or false
.
mg_mutate_message_body
Allows an external plugin to mutate the message body before sending.
Should accept an array, $body
.
Should return a new array to replace $body
.
mg_mutate_attachments
Allows an external plugin to mutate the attachments on the message before
sending.
Should accept an array, $attachments
.
Should return a new array to replace $attachments
.
What hooks are available for use with other plugins?
mg_use_recipient_vars_syntax
Mutates messages to use recipient variables syntax – see
https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending for more info.
Should accept a list of To
addresses.
Should only return true
or false
.
mg_mutate_message_body
Allows an external plugin to mutate the message body before sending.
Should accept an array, $body
.
Should return a new array to replace $body
.
mg_mutate_attachments
Allows an external plugin to mutate the attachments on the message before
sending.
Should accept an array, $attachments
.
Should return a new array to replace $attachments
.
From mail
Fatal error on lists page when another plugin redeclare wp_mail()
Reply-to
header. It’s not overridden anymoremailgun_error_track
h:Sender
from name
for WoocommerceOverride "From" Details
was not updatedtext/html
emails to send as both text/plain
andtext/html
partshtmlonly
(https://github.com/mailgun/wordpress-plugin/pull/58)pt_BR
translations (thanks @emersonbroga)mg_mutate_message_body
hook to allow other plugins to modify the message body before sendmg_mutate_attachments
hook to allow other plugins to modify the message attachments before sendmg_mutate_message_body
hook to allow other plugins to modify the message body before sendmg_mutate_attachments
hook to allow other plugins to modify the message attachments before sendMG_DEBUG_SMTP
constantUndefined property: MailgunAdmin::$defaults
when saving config$mailgun['override-from']
without checking isset
From Address
notephpmailer_init
/ SMTP now will honour Mailgun “From Name / From Addr” settingsundefined variable: content_type
error in wp-mail.php
(https://wordpress.org/support/topic/minor-bug-on-version-version-1-5-6/#post-8634762)undefined index: override-from
error in wp-mail.php
(https://wordpress.org/support/topic/php-notice-undefined-index-override-from/)wp_mail_content_type
(#37 – @FPCSJames)admin_notices
codearray()
syntaxwp_mail_from
/ wp_mail_from_name
not working on old PHP / WP versionsmime_content_type
/ finfo_file
array()
syntax for older PHP supportContent-Type
processing code to not make such large assumptionsMailgun Lists
admin panel bugfix