Configure SMTP for outbound emails
- Google Cloud Platform doesn’t allow SMTP traffic through default ports: 25, 465, 587. Check Google cloud documentation to learn how to use a VPN to bypass these restrictions or use a different port for sending emails from your application.
Follow these steps:
Configure email settings by editing the /opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.7.8-py2.7.egg/django/conf/global_settings.py file. Here’s an example using Gmail. Replace USERNAME and PASSWORD with your Gmail account username and password respectively.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'USERNAME@gmail.com' EMAIL_HOST_PASSWORD = 'PASSWORD' EMAIL_USE_TLS = True
Restart the Apache server for the changes to take effect.
$ sudo /opt/bitnami/ctlscript.sh restart apache
To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid, refer to the FAQ.
NOTE: If you are using Gmail as the outbound email server and have experienced issues trying to send emails correctly, check the Gmail SMTP troubleshooting page to learn the causes of these issues and how to solve them.