Django / Postfix — Connection Refused on send_mail on OSX

I was having trouble sending email from my local development environment (OS X) via django’s send_mail, and thus smtplib.

I figured out I need to enable postfix for OSX following the directions here:

Except I had to do as a comment mentioned in the post, write each key/value as its own line, like so:


Check if postfix is running by typing sudo postfix status

If it’s not running, just start it: sudo postfix start

Now try connecting to it via localhost port 25

s = smtplib.SMTP('localhost')
# or send_mail

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s