Skip to content

Instantly share code, notes, and snippets.

@okwrtdsh
Created April 7, 2016 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okwrtdsh/19474e37430af0c017ce76d47526bea5 to your computer and use it in GitHub Desktop.
Save okwrtdsh/19474e37430af0c017ce76d47526bea5 to your computer and use it in GitHub Desktop.
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com' 
EMAIL_HOST_USER = 'youremail@gmail.com'  # 使用するgmailアカウント
EMAIL_HOST_PASSWORD = 'yourpassword'     # 使用するgmailアカウントのパスワード
EMAIL_PORT = 587
> python manage.py shell

>>> from django.core.mail import send_mail

>>> send_mail(u'タイトル', 
              u'本文',
             'from@example.com',
             ['to@example.com'],   # 送信先アドレス
             fail_silently=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment