vitorfs / colossus

Self-hosted email marketing solution
https://colossus.readthedocs.io
MIT License
503 stars 128 forks source link

Gmail SMTP not working #29

Closed alexauvray closed 5 years ago

alexauvray commented 5 years ago

I tried using Gmail SMTP but nothing happens. Any idea ?

EMAIL_SUBJECT_PREFIX` = '[Colossus] '

SERVER_EMAIL = config('SERVER_EMAIL', default='colossus@simpleisbetterthancomplex.com')

DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', default='hello@mysite.com')

EMAIL_BACKEND = config('EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')

EMAIL_HOST = config('EMAIL_HOST', default='smtp.gmail.com')

EMAIL_PORT = config('EMAIL_PORT', default=465, cast=int)

EMAIL_HOST_USER = config('EMAIL_HOST_USER', default='myemail@gmail.com')

EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default='myPassword')

EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=True, cast=bool)
vitorfs commented 5 years ago

Make sure you have SMTP backend configurated:

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

Also keep in mind that Gmail is not intended to send transactional emails via SMTP, so it is not suitable for production usage (you will also have limit of emails you can send per day, because it is a personal email)

You may need to tweak some settings on your Gmail account: https://support.google.com/accounts/answer/6010255

There are better options like Mailgun and SendGrid that are designed for this use case. Both offer a handful of free messages per month.

Some tutorials that can help you to get started: