Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Adding instructions for using gmail for smtp #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ heroku config:add MAIL_PORT=<from mail port>
heroku config:add TO_EMAIL=<email to send to>
```

Since the app connects to MAIL_SERVER using the TLS protocol, it's likely that MAIL_PORT will need to be 587.

### Using gmail as your email server

Here is an example configuration for using [gmail as the SMTP server](https://support.google.com/a/answer/176600?hl=en):

```
MAIL_USERNAME=<gmail or google apps email address to send from>
MAIL_PASSWORD=<from email password>
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
TO_EMAIL=<email to send to>
```

Note: in order to use gmail, you will have to turn on ["Access for less secure apps"](https://support.google.com/accounts/answer/6010255) for your "from" email. If you are using 2-factor authentication, you may also have to create an [App Password](https://support.google.com/accounts/answer/185834?hl=en#ASPs). See [this gmail help page](https://support.google.com/mail/answer/14257?rd=1) for solutions to other problems you may encounter.

### Testing your email configuration

Regardless of what you're using for an SMTP server, you can test your email setup by running `python test.py`. If you see "OK" at the end of the output, you're good to go.

## Step 4: Check it out!

Run ```heroku open``` to see your snazzy new site in a web browser :)
Expand Down