Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ```python
  2. EMAIL_USE_TLS = True
  3. EMAIL_HOST = 'smtp.gmail.com'
  4. EMAIL_HOST_USER = 'youremail@gmail.com' # 使用するgmailアカウント
  5. EMAIL_HOST_PASSWORD = 'yourpassword' # 使用するgmailアカウントのパスワード
  6. EMAIL_PORT = 587
  7. ```
  8.  
  9. ```shell
  10. > python manage.py shell
  11.  
  12. >>> from django.core.mail import send_mail
  13.  
  14. >>> send_mail(u'タイトル',
  15. u'本文',
  16. 'from@example.com',
  17. ['to@example.com'], # 送信先アドレス
  18. fail_silently=False)
  19. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement