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

**Code:** `SMTPRecipientsRefused` · **Category:** Email / SMTP · **Seen on:** Python, SMTP

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/email/python-smtplib-smtprecipientsrefused)
