1.More natural and popular way interact with SMTP-services in django is an SMTP email backend:
- Define next variables in a project's settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'youremail@gmail.com' EMAIL_HOST_PASSWORD = 'email_password' EMAIL_PORT = 587
- And connect built-in forms, for example a password reset form.
2.Another way available in SendPulse is interaction via API.
- Add custom.py in your project by locating the file in next directory:
"...\site-packages\django\core\mail\backends"
- Define next variables in a project's settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = 'your@email.com' EMAIL_HOST_USER = 'youremail@gmail.com' EMAIL_HOST_PASSWORD = 'email_password'
- And connect built-in forms, for example a password reset form.