setting.py
去查收邮件吧!
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.qq.com'
EMAIL_PORT = 25
EMAIL_HOST_USER='112345@qq.com'
EMAIL_HOST_PASSWORD='Abc123!@#$%^&*'
view.py
from django.core.mail import send_mail
title='This is mail title.'
message='Hello! This is a message!'
sender='112345@qq.com'
mail_list=['abcdef@msn.com',]
send_mail(
subject=title,
message=message,
from_email=sender,
recipient_list=mail_list,
fail_silently=False,
connection=None
)
去查收邮件吧!
关于html格式的邮件,附件等等,都好解决。