Skip to main content
Once your Mailgun provider and IP Pool are configured, you can send emails through Mailgun using the standard SendPost API.
Important: You must include the ippool parameter in your API request to route emails through Mailgun.

Basic Email Example


Email with Personalization


Using Mailgun IP Pools

If you have IP Pools configured in your Mailgun account, you can specify which Mailgun IP Pool to use via the tpspIppool parameter.
The tpspIppool field is optional. Use it when you want to route emails through a specific IP Pool on the Mailgun side, separate from the SendPost IP Pool routing.
Parameters:
  • ippool: The SendPost IP Pool that routes traffic to Mailgun (required)
  • tpspIppool: The IP Pool name configured in your Mailgun account (optional)

Using a Specific Mailgun IP Address

If you have dedicated IPs in your Mailgun account, you can specify a specific IP address to use for sending via the tpspIp parameter.
The IP address specified must be owned by your Mailgun account. This is different from IP pools which allow Mailgun to select an IP from a pool.
Parameters:
  • ippool: The SendPost IP Pool that routes traffic to Mailgun (required)
  • tpspIp: The specific IP address owned by your Mailgun account (optional)

Response

Success Response (HTTP 200):

Next Steps