2

The code I am using is what I found on webfaction

EMAIL_HOST = 'smtp.webfaction.com'
EMAIL_HOST_USER = '<mailbox name>'
EMAIL_HOST_PASSWORD = '<mailbox pass>'
DEFAULT_FROM_EMAIL = '<email address>'
SERVER_EMAIL = '<email address>'

I keep on getting the error SMTPRecipientsRefused

Sender address rejected: need fully-qualified address

Nader Alexan
  • 2,127
  • 22
  • 36
  • 1
    Well, you actually have to use real input for those lines. `''` is indeed not a fully-qualified address. – admdrew Nov 04 '13 at 20:41
  • 1
    For me I got this error when I did not have `DEFAULT_FROM_EMAIL` set in settings.py – timbram Jul 21 '18 at 21:20

2 Answers2

6

I figured out the problem, it was not in the settings, the settings are correct, it was while sending the actual email in views.py I used a different email address in the from_email field.

Nader Alexan
  • 2,127
  • 22
  • 36
5

The problem is that you have not configured well your settings on webfaction control panel.

You have to follow these steps described in the docs

  1. Create a mailbox
  2. Create an email address
  3. Link your address to your mailbox

In my code I have this:

EMAIL_HOST = 'smtp.webfaction.com'
EMAIL_HOST_USER = 'infomailbox'
EMAIL_HOST_PASSWORD = '<<mine>>'
DEFAULT_FROM_EMAIL = 'info@example.com'
SERVER_EMAIL = 'info@example.com'

It works perfect for me.

Marc Tudurí
  • 1,869
  • 3
  • 18
  • 22