SMTPRecipientsRefused Email / SMTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

Python smtplib.SMTPRecipientsRefused: {'user@example.org': (550, b'5.7.1 Relaying denied')}

The SMTP server refused all recipients, and smtplib raised the aggregated error.

Exact message you may see SMTPRecipientsRefused: {'a@b.com': (550, b'5.7.1 Relaying denied')}smtplib.SMTPRecipientsRefused: {'user@example.org': (550, b'5.1.1 user unknown')}SMTPRecipientsRefused Python sendmail(550, b'Relay access denied')
Seen on: Python SMTP

Meaning

The dict shows each recipient with the server's code and message. Typical causes: relay denied (need authentication), unknown user, recipient domain blocked, or sender policy. Authenticate with login(), use valid recipients, and for sandbox/relay services verify recipients.

Common causes

  • Not authenticated, relay denied
  • Invalid/unknown recipients
  • Provider sandbox/unverified recipients
  • Policy or blocklist rejection
  • Typos in addresses

⚡ Quick fix

  1. Authenticate (server.login(...)) before sendmail
  2. Check each recipient's code in the exception dict
  3. Verify recipients in sandbox accounts

Detailed fix by platform

Python

  1. python
    try:
        server.sendmail(sender, recipients, msg.as_string())
    except smtplib.SMTPRecipientsRefused as e:
        print(e.recipients)   # {addr: (code, message)}

How to diagnose

  1. Code — Per recipient?
  2. Auth — Done?
  3. Sandbox — Unverified?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

5.4.310 — Exchange Online: 550 5.4.310 DNS domain does not exist (DNS domain name could not be resolved) (Email / SMTP)5.4.310550 5.1.8 — 550 5.1.8 Sender address rejected: Domain not found (sender domain has no DNS A/MX) (Email / SMTP)550 5.1.8550 5.2.1 — 550 5.2.1 The email account you tried to reach is disabled / mailbox not accepting messages (Email / SMTP)550 5.2.1550 5.7.1 — 550 5.7.1 Relaying denied / Message rejected as spam / Unauthenticated email not accepted (Email / SMTP)550 5.7.1certifi — requests SSLError: CERTIFICATE_VERIFY_FAILED because certifi is outdated (missing a new root CA) (SSL / TLS)certifiEOF occurred in violation of protocol — Python: ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2396) (SSL / TLS)EOF occurred in viola…HTTPSConnectionPool: Max retries exceeded (SSLError) — Python requests: HTTPSConnectionPool(host='api.example.com', port=443): Max retries exceeded with url: /v1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ...'))) (SSL / TLS)HTTPSConnectionPool: …macOS — Python on macOS: SSL: CERTIFICATE_VERIFY_FAILED unable to get local issuer certificate (run Install Certificates.command) (SSL / TLS)macOSSMTPRecip…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.