We're experiencing difficulty. Our engineers are on it. Please check status.mailgun.com for real-time updates.

Can I Customize My SMTP Credentials?

Table Of Contents
Quick Overview
Using The Control Panel
Using The Domains API
    When Creating New Credentials
    When Updating Existing Credentials
    Potential Password Errors
Got Questions?

Quick Overview

Yes, SMTP credentials can be customized through either of two methods: the Mailgun Control Panel or the Domains API. For more information regarding passwords and security in general, check out this blog post!

Note: if you're instead seeking to create SMTP credentials with system-generated passwords by way of the Mailgun Control Panel, please take a look at this article.

Using The Control Panel

We'll show you how to do this below:

  1. First, log in to the Mailgun Control Panel (if you have not already done so).
  2. Then, within the left-hand navigation pane, click the Sending option to expand its list of suboptions.
  3. Next, click the Domain settings suboption, and then click on the SMTP credentials tab.
  4. Ensure that the domain for which you wish to create a customized SMTP password is displayed within the Domain drop-down list towards the upper-right portion of the page.
    Screen Shot 2022-09-11 at 6.58.43 PM.png
  5. To customize the password, click the Reset password button.
    Screenshot 2023-05-03 at 6.55.14 AM.png
  6. Select Manual in the Password creation method drop-down.
    Screenshot 2023-05-03 at 6.55.36 AM.png
  7. Enter your password (between 5 and 32 characters in length), and then save your password by clicking the Reset Password button.
    Screenshot 2023-05-03 at 6.55.47 AM.png
  8. NOTE: The new SMTP password will be available within a dark-gray notification window that appears in the bottom-right portion of the Control Panel. Save this password in your application and in a secure password manager, as it will not be displayed again

Using The Domains API

When Creating New Credentials

For example, the below HTTP POST request to the Domains API creates a new pair of SMTP credentials (customized password included): 

# if the domain and its credentials reside in the US region
curl -s --user 'api:YOUR_API_KEY' \
 https://api.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials \
 -F login='alice@YOUR_DOMAIN_NAME' \
 -F password='supaSecret123987@#$butNotTh@t$ecrET'

# if the domain and its credentials reside in the EU region
curl -s --user 'api:YOUR_API_KEY' \
https://api.eu.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials \
 -F login='alice@YOUR_DOMAIN_NAME' \
-F password='supaSecret123987@#$butNotTh@t$ecrET'

This endpoint can be found in our API documentation.

When Updating Existing Credentials

But what if you wish to update an existing pair of SMTP credentials rather than create a new pair of SMTP credentials? To update an existing pair of SMTP credentials with a new customized password, an HTTP PUT request will be needed:

# if the domain and its credentials reside in the US region
curl -s --user 'api:YOUR_API_KEY' -X PUT \
https://api.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials/alice \
-F password='abc123'

# if the domain and its credentials reside in the EU region
curl -s --user 'api:YOUR_API_KEY' -X PUT \
https://api.eu.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials/alice \
-F password='abc123'

The above is the 7th example ("Updating the password for a given credential pair") in the aforementioned API documentation.

Potential Password Errors

If Mailgun considers the password too short, you'll see this API response:

{
"message": "Password is too short."
}

And if Mailgun considers the password insecure, you'll see this API response:

{
"message": "Password is not secure."
}

The solution to either case is to increase the complexity of the password. 

Got Questions?

Sinch Mailgun has answers! If you have any concerns or questions, please send us a Support ticket using the Support page within your Mailgun Control Panel.  Our Support Team will be happy to assist!