Sending emails in Django using Mailtrap

We will need to send emails in order to test the password reset module; configuring a mail server is outside the scope of this book and because not all readers are able to configure their own or already have one, we will use a service that allows us to simulate sending emails:

https://mailtrap.io/

Once a development server is registered and created, we must configure the following variables:

customlogin\settings.py

EMAIL_HOST = 'smtp.mailtrap.io'
EMAIL_HOST_USER = '<YourUserMailTrap>'
EMAIL_HOST_PASSWORD = '<YourPasswordMailTrap>'
EMAIL_PORT = '2525'

Which determine the host, user, password and port of the mail server respectively; With this, we are ready for the application to send emails.

- Andrés Cruz

En español
Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.