In this lesson, you’ll set up a Mailgun account.
Sending Emails to the Outside World
00:00 Sending Emails to the Outside World. At the moment, your application isn’t actually sending emails. They’re just being viewed in the console as Django is using the console email backend set up earlier in the course.
00:15 It would be far more useful to send emails to actual email addresses. One way to do this is using Mailgun. For this step, you’ll need a Mailgun account. The basic version is free and will let you send emails from a rather obscure domain, but it will work for the purpose of this course.
01:02 You should find the following values: SMTP hostname, port, username, and default password. All you need to do is add these values to the settings file. Keep in mind that you should never include any credentials directly in your code.
03:13 After creating this user, navigate to the password reset page and enter your email address and press Send. The process of sending an email will take a bit longer than with the local server. After a few moments, the password reset email should arrive in your inbox.
03:31 It may be in your spam folder, so don’t forget to check that too. As you can imagine, Mailgun’s free account has limitations. You can only send emails to five email addresses, which you need to pre-approve.
03:48 To have a fully functional solution, you’d either need to upgrade your account or look for a different email provider that would fulfill your needs. However, by changing the relevant settings you’ve already looked at in this section, you should be able to get up and running quickly with any other email service provider. In the next section of the course, you’ll take a look at a different way to log in to your site by using a GitHub account.
Become a Member to join the conversation.