## Mailgun ### Portal configuration To configure Mailgun via the **Frontegg portal**, go to your [ENVIRONMENT] → Configurations → Authentication → Emails → Providers. Press **Connect** and fill in the relevant details required by Mailgun. To integrate with Mailgun, you must fill in the values for the **API key** and **Domain name** fields. To obtain these values, go to your Mailgun dashboard → API Keys → API Security → Mailgun API Keys. API keys Note that when creating a new API key, the value will only display once, so make sure to copy it and store it somewhere safe yet accessible. ![mailgun-1](/assets/mailgun-1.0ce7df3eec35c8fe52e7658c7397d7a77f83154f062a209c9081554b41412a16.43a8bf40.png) br ![mailgun-2](/assets/mailgun-2.2df7cff20956686cd575bdbfd6f2928e838ac6162bdf5b51083d862d6f8e2dab.43a8bf40.png) Region The **Region** field is mandatory. You can choose between the **Mailgun US** or **Mailgun EU** regions, depending on the location of your account. ### API configuration To configure your external email provider via API, send a POST request to the following URL: `https://{domain}.frontegg.com/identity/resources/mail/v2/configurations`. In your POST request, include the mandatory fields filled with credentials from your Mailgun account. To configure Mailgun specifically, you will need to send values for the `secret`, `domain`, and `region` fields. The **secret** refers to the API key obtained in the portal configuration section. Prerequisites - An environment token from the authentication route is required to use this API. Check out the [Getting Started with Frontegg APIs](/ciam/api/overview) topic to learn more. - You will need to fill in the **region** field when invoking the request. Use `us` for US accounts and `eu` for European accounts. ![mailgun-3](/assets/mailgun-3.6c2fece910daf8ad70eb4e023a12fcf0ab4e7201c2921bbaf6152eb40a095388.43a8bf40.png) The **domain** value is located in the left-hand menu of your Mailgun dashboard. Go to the **Send** section → Sending → Domains, as indicated below: ![mailgun-4](/assets/mailgun-4.d37e851508811c60c123c949b21b0eca8878a34d15d4cb318389d7478191df80.43a8bf40.png)