Search code examples
pythondjangoemailsmtpwebfaction

django email username and password


I'm implementing a contact form for one of my sites. One thing I'm not sure I understand completely is why you need EMAIL_HOST_USER and EMAIL_HOST_PASSWORD.

The user would only need to provide his/her email address, so what is the EMAIL_HOST_USER referring to then and why would I need to specify an email and password?

EDIT: I'm using webfaction as my mail server


Solution

  • You set EMAIL_HOST and EMAIL_PORT just for sending emails to your user.

    Mail is sent using the SMTP host and port specified in the EMAIL_HOST and EMAIL_PORT settings. The EMAIL_HOST_USER and EMAIL_HOST_PASSWORD settings, if set, are used to authenticate to the SMTP server, and the EMAIL_USE_TLS and EMAIL_USE_SSL settings control whether a secure connection is used.