Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Email Settings
- EMAIL_HOST = 'smtp.lolipop.jp'
- EMAIL_PORT = '465'
- EMAIL_HOST_USER = 'my_account'
- EMAIL_HOST_PASSWORD = 'my_password'
- EMAIL_USE_TLS = True
- # EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
- DEFAULT_FROM_EMAIL = 'info@test.com'
- # Send email
- template = get_template('emails/signup.html')
- content = template.render(Context({'onetime_code': user.onetime_code}))
- subject = 'test'
- from_email = 'info@test.com'
- email = EmailMultiAlternatives(
- subject,
- content,
- from_email,
- [user.email]
- )
- email.attach_alternative(content, "text/html")
- email.send()
- return redirect('/invoice')
Add Comment
Please, Sign In to add comment