Sending email by using QQ smtp service in Django
* How to configure QQ smtp
* How to configure Django
Here I masked the PASSWORD.
If it return 1, it means that the email has been sent to the target email.
* How to configure Django
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST_USER = "327696170@qq.com"
EMAIL_HOST = 'smtp.qq.com'
EMAIL_PORT = 25
EMAIL_USE_TLS = True
EMAIL_HOST_PASSWORD = "ymlb****c"
Here I masked the PASSWORD.
Run
python manage.py shell
:from django.core.mail import send_mail
email_title = 'from hester'
email_title = 'from hester'
email_body = 'password reset'
email = 'email_you_want_to_send_to'
send_mail(email_title,email_body,'327696170@qq.com',[email])
If it return 1, it means that the email has been sent to the target email.
Comments
Post a Comment