2

I'm starting the server (on mac) this way:

python -m smtpd -n -c DebuggingServer localhost:9999

and i don't get any errors or any other notifications. I guess it means all is ok, correct me if i'm wrong.

But when i send emails from django shell or from my app, using send_mail/mail_managers with fail_silently=False, i dont see any output on smtpd debug server. I dont get any SMTPErrors, and send_mail/mail_managers returns 1.

I ran:

lsof -i | grep LISTEN

to see if anyone listens to port 9999, and nope, no one does. Does it mean that something wrong with smtp debug server? Is it supposed to show on the list of listeners?

My email settings:

EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 9999
Neara
  • 3,693
  • 7
  • 29
  • 40

1 Answers1

6

I think you need to use the default smtp backend

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
sneawo
  • 3,543
  • 1
  • 26
  • 31
  • 2
    To explain a bit more, the [dummy backend](https://docs.djangoproject.com/en/dev/topics/email/#dummy-backend) doesn't do anything with your email. You need to use the default backend to actually send the email to your debug mail server. – Alasdair Dec 24 '12 at 10:48
  • ok, i changed it to the default backend and restarted the server, but still nothing. – Neara Dec 24 '12 at 10:51
  • is there anyway to make send_mail/mail_managers give a more detailed output? – Neara Dec 24 '12 at 10:53
  • Ok! it works, ty!! just one more thing i had to change is to run the server with `sudo`. – Neara Dec 24 '12 at 12:10