Mailgun: "The 'address' parameter should be a valid email address"
Mailgun returns this error when the address sent to its mailing list API is empty or malformed. The usual causes are a blank field in your export, stray whitespace, a display name mixed into the address, or an unencoded plus sign. Find the bad value, clean it, and resend.
Sohail Hussain7 min readShort answer
- Mailgun received an address value it could not read as one bare email address. The most common cause is an empty value, so check for blank rows first.
- Then look for spaces, display names like Jane Doe in angle brackets, two addresses in one field, and a plus sign that was not URL-encoded.
- Trim and validate every address before you send, and put the name in the separate name parameter.
You are adding people to a Mailgun mailing list, through the API or through a plugin or export tool that calls it, and the request fails with this:
The 'address' parameter should be a valid email address
The message does not say which row failed. This guide shows how to find the bad value, fix it, and stop it from coming back.
Why it happens
Mailgun's mailing list endpoints take an address parameter for each member. Adding one member with POST /v3/lists/{list_address}/members carries one address; the bulk endpoint takes a JSON array of members.
The error is an input-validation failure, which Mailgun returns as a client-side error (HTTP 400). Nothing is wrong with your domain, DNS, sending reputation or API key. The API simply would not accept the string you put in address. Users on community forums report the same message when exporting from WordPress to a Mailgun list through an export plugin, which points to a data or mapping problem rather than a Mailgun fault.
Causes, most common first:
| Cause | What you see | Fix |
|---|---|---|
| Blank address | Request has address= with nothing after it | Skip empty rows, fix the column mapping |
| Whitespace or hidden characters | Address looks fine on screen but fails | Trim, strip mailto:, brackets, quotes |
| Several things in one field | Two addresses, or a display name mixed in | One bare address per member |
Raw + in a form-encoded body | jane+news@example.com arrives as jane news@example.com | Let your HTTP library encode the field |
| One bad entry in a bulk upload | Whole request fails, no row named | Bisect the batch, then validate first |
Step-by-step fixes
1. Check for a blank address
This is the likeliest cause. A mapping points at the wrong column, a user record has no email, or a template variable never got filled, so the request goes out with an empty address.
- Log the exact request body just before it is sent.
- If you import from a CSV, scan the email column for empty cells.
- Skip any record whose address is empty after trimming.
- Correct the field mapping so it points at the real email column.
Tools that loop over records (export plugins, automation steps, scripts) can stop on the first empty one and report only that, so one blank row can hide others.
2. Strip whitespace and hidden characters
A trailing space, a newline from a CSV line ending, or a non-breaking space copied from a spreadsheet can fail validation even though the address looks fine.
- Trim the value before sending.
- Remove a leading
mailto:if your data came from web links. - Remove surrounding angle brackets or quotes.
Spreadsheet exports
Spreadsheet exports sometimes start with a byte-order mark that breaks the first column name and produces blanks. Open the file as UTF-8 with BOM handling, as in the script below.
3. Send one bare address per member
These all fail:
jane@example.com, bob@example.com(two addresses in one field)Jane Doe <jane@example.com>(display name mixed in)jane@example,com(comma typo)jane@example(no top-level domain)
Split multi-address cells into separate rows. Put the person's name in the separate name parameter.
4. Encode the plus sign
Addresses like jane+news@example.com are valid. But if you build a form-encoded request by hand and leave the + raw, the server decodes it as a space, and jane news@example.com is not valid. Let your HTTP library encode form fields, or use -F with curl:
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/lists/lists@example.com/members \
-F address='jane+news@example.com' \
-F name='Jane Doe' \
-F subscribed=true
The same applies if the address sits in the URL path when you update or delete a member: encode it there too. EU-region accounts use api.eu.mailgun.net instead.
5. Find the bad row in a bulk upload
With the bulk endpoint (/members.json), one malformed entry in the members array can fail the request, and the response may not name the entry. Bisect it:
- Split the batch in half and resend each half.
- Keep halving the half that fails.
- Stop when one entry remains; that is your offender.
Better, validate before you batch.
Validate before you send
A small pre-flight check removes most of these failures. It does not need to be a full RFC parser; it only needs to catch obvious breakage:
import csv, re
pattern = re.compile(r"^[^@\s,<>;]+@[^@\s,<>;]+\.[^@\s,<>;]+$")
good, bad = [], []
with open("export.csv", newline="", encoding="utf-8-sig") as f:
for row in csv.DictReader(f):
email = (row.get("email") or "").strip().lower()
(good if pattern.match(email) else bad).append(row)
print(len(good), "ok;", len(bad), "rejected")
Write the bad rows to a file and read them. You will usually see a pattern, such as one data source that leaves the field empty. The utf-8-sig encoding drops the byte-order mark mentioned above.
Syntax checking only proves the string is shaped like an address, not that the mailbox exists. For that, see our notes on validation and email list hygiene. Addresses that pass syntax but do not exist show up later as a hard bounce.
Checklist before you try again
- No empty
addressvalues after trimming. - One bare address per member, no display names, no commas or semicolons.
- No
mailto:, angle brackets or quotes around the value. - The
+and other special characters are encoded by your HTTP library. - The name is in the
nameparameter, not inaddress. - You are calling the right region host (US or EU).
If nothing works
If every address in the payload is clean and the error persists, contact Mailgun support through your Mailgun account. Include:
- The exact request (endpoint and parameters, with the API key removed).
- The full JSON response and the timestamp.
- Your region (US or EU) and the list address.
- One example address that fails, with its raw bytes if you suspect hidden characters.
That helps them tell whether the rejection is a parsing quirk on their side, for example with an internationalized domain, rather than a data problem. Check Mailgun's own documentation for current parameter rules, since they can change.
Subject: 400 "The 'address' parameter should be a valid email address" on list member add
Hi, adding members to the list {list-address} (region: {US or EU}) fails with:
The 'address' parameter should be a valid email address
Endpoint: {endpoint}
Timestamp (UTC): {timestamp}
Example failing address: {address}
Already tried: trimmed whitespace, removed display names, URL-encoded the field, bisected the batch.
Full request (API key removed) and response attached.
Can you confirm why this value is rejected?
Preventing it
- Reject empty or malformed addresses where you collect them, not at upload.
- Normalize on the way in: trim, lowercase, strip
mailto:and brackets. - Keep the name in a separate field from the address.
- Log the rejected rows from every import so a recurring bad source gets noticed.
Common questions
Does this error mean my Mailgun account or domain has a problem?
No. It is an input-validation error on the request, not a DNS, reputation or API key issue.
Is an address with a plus sign valid?
Yes, jane+news@example.com is valid. It fails only when the plus sign is sent unencoded in a form body and arrives as a space.
Why does the error not tell me which row failed?
For bulk requests the response may reject the whole batch without naming the entry. Bisecting the batch or validating locally first is the practical way to find it.
Will passing this check mean the email will be delivered?
No. It only means the string looks like an address. A mailbox that does not exist will bounce later.
Explore: Email Marketing Strategy
Related Articles
Mailgun 401 Unauthorized (MailgunAPIError): Cause and Fix
Mailgun returns a 401 when the API key, the domain or the region in your request doesn't match your account. Use a key from the same account, send through a domain that key can access, and point the client at api.eu.mailgun.net if the domain was created in the EU region.
414 Request-URI Too Large in n8n's Amazon SES node: fix
The error 414 Request-URI Too Large in n8n's AWS SES node means a server in the path refused a request whose URL was too long, which a long HTML body can cause when it travels in the URL. Send through the SES v2 API with an HTTP Request node, or use SES SMTP.
Access denied, bad outbound sender: Outlook cold email fix
"Access denied, bad outbound sender" (550 5.1.8) means Microsoft 365 has put your mailbox on its restricted users list for spam-like sending. An admin must unblock it under Restricted entities in the Microsoft Defender portal. Then clean your list, lower your volume and resume gradually.
Acoustic Campaign "Application error" on login: bookmark fix
Acoustic Campaign shows "application error" at login when you open it from a bookmark saved while you were logged in, because the bookmark carries the old session. Log out, type your pod URL (campaign-us-[X].goacoustic.com) into the address bar, log in, then save a fresh bookmark.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free