open:django-email

django email

GMail SMTP 서버
GMail의 SMTP 서버를 이용하기 위해서는 두 가지 설정을 해줘야한다

snippet.python
from django.core.mail import send_mail
 
send_mail(
    'Subject here',
    'Here is the message.',
    '[email protected]',
    ['[email protected]'],
    fail_silently=False,
)
snippet.python
from django.core.mail import EmailMessage
 
email = EmailMessage(
    'Hello',
    'Body goes here',
    '[email protected]',
    ['[email protected]', '[email protected]'],
    ['[email protected]'],
    reply_to=['[email protected]'],
    headers={'Message-ID': 'foo'},
).send()
  • open/django-email.txt
  • 마지막으로 수정됨: 2020/06/02 09:25
  • 저자 127.0.0.1