Pergunta

I'm new to Vagrant and I'm building my website using Django, really cool but now I need to send emails from my vagrant box (Ubuntu) and I'll be using the Django function send_mail().

I'm not sure how to proceed, I guess I'll need to install the postfix cookbook, probably check that there are no issues with the ports, and it should be ok?

If you could just give me some tips, what's best, recommended, the easiest way, I would greatly appreciate it!

Thanks,

Foi útil?

Solução

Django had an email backend that outputs the email to the console. Add this to your settings:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

Also you can run a python SMTP server with:

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

Please, check this https://docs.djangoproject.com/en/dev/topics/email/#testing-email-sending

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top