Guest User

Untitled

a guest
Nov 12th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # Email Settings
  2. EMAIL_HOST = 'smtp.lolipop.jp'
  3. EMAIL_PORT = '465'
  4. EMAIL_HOST_USER = 'my_account'
  5. EMAIL_HOST_PASSWORD = 'my_password'
  6. EMAIL_USE_TLS = True
  7. # EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  8. DEFAULT_FROM_EMAIL = 'info@test.com'
  9.  
  10. # Send email
  11. template = get_template('emails/signup.html')
  12. content = template.render(Context({'onetime_code': user.onetime_code}))
  13. subject = 'test'
  14. from_email = 'info@test.com'
  15. email = EmailMultiAlternatives(
  16. subject,
  17. content,
  18. from_email,
  19. [user.email]
  20. )
  21. email.attach_alternative(content, "text/html")
  22. email.send()
  23.  
  24. return redirect('/invoice')
Add Comment
Please, Sign In to add comment