我想從django網絡應用程序發送電子郵件。我用以下電子郵件發送django
from django.core.mail import send_mail
send_mail('test email', 'hello world', '[email protected]', ['[email protected]'])
我的設置是
DEFAULT_FROM_EMAIL = '[email protected]'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'XXXXXXXXXX'
我總是從 「[email protected]」 getiing郵件。雖然我傳遞了send_from值。
,如果你做一個實際的['EmailMessage'(https://docs.djangoproject.com/en/1.9/topics/email/#emailmessage-objects)對象這是相同的?從電子郵件通常只使用,如果它被省略 – Sayse
yaa在這種情況下,我越來越相同 –