“Django -E -Mail -Einstellungen” Code-Antworten

Django -E -Mail -Einstellungen

EMAIL_BACKEND =‘django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST = ‘smtp.gmail.com’
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = ‘[email protected]’
EMAIL_HOST_PASSWORD = ‘your account’s password’
Flavius Teodorof

Django -E -Mail -Änderung Absendername

>>> from django.core.mail import send_mail
>>> send_mail('subject', 'message', 'Dont Reply <[email protected]>', ['[email protected]'])
Repulsive Raven

Django -E -Mail

from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context

plaintext = get_template('email.txt')
htmly     = get_template('email.html')

d = Context({ 'username': username })

subject, from_email, to = 'hello', '[email protected]', '[email protected]'
text_content = plaintext.render(d)
html_content = htmly.render(d)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
Juan Gt

Ähnliche Antworten wie “Django -E -Mail -Einstellungen”

Fragen ähnlich wie “Django -E -Mail -Einstellungen”

Weitere verwandte Antworten zu “Django -E -Mail -Einstellungen” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen