Answer the question
In order to leave comments, you need to log in
Does anyone have the python 3+ mailing code?
Good afternoon.
I want to connect an e-mail newsletter to my django project, does anyone have the mailing code? It is desirable to be able to include html/css templates. Thank you.
Answer the question
In order to leave comments, you need to log in
def hello(request):
subject = u'Получите и распешитесь'
message = u'Спасибо'
from_email = settings.EMAIL_HOST_USER
to_list = ['[email protected]']
send_mail(subject, message, from_email, to_list, fail_silently=False)
return HttpResponse("hello")
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' #отправляет письма в консоль
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'pass'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = '[email protected]'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question