Configuring 163 Mailboxes
#邮件发送配置
email_backend = ' django.core.mail.backends.smtp.EmailBackend '
email_host = ' smtp.163.com '
Email_port =
#发送邮件的邮箱
email_host_user = ' *******@163.com '
#在邮箱中设置的客户端授权密码
email_host_password = ' '
#收件人看到的发件人
email_from = ' python<*****@163.com> ' # requires the same as the mailbox number
Configure QQ Mailbox
# Use QQ mailbox to send mail
email_host = ' smtp.qq.com '
mailbox
email_host_user = ' ******* @qq. com '
authorization code
EMAIL_ Host_password = ' ********* '
port
email_port = 587
email_use_tls = True
email_from = ' ******** @qq. com ' need to match the mailbox number
view function from Django.core.mail import send_mail from django.conf import Settings def send_email_d Emo (Request): from_who = settings. Email_from # The sender has been written in the configuration of the direct type configuration in the Get to_who = ' ******@163.com ' # recipient is a list subject = ' Send a connection ' # Send the subject # sent Message = ' Click to jump Oh ha ha ha hehe ' # Send ordinary messages when using message # meg_html = ' <a href= ' http://www.baidu.com ' > click Jump </A&G t; ' # sent is an HTML message that needs to be specified Send_mail (subject, message, from_who, [to_who], html_message=meg_html) return HttpResponse ("OK ")" "Source: Send_mail Source Parameters many def send_mail (subject, message, From_email, Recipient_list, Fail_silen Tly=false, Auth_user=none, Auth_password=none, Connection=none, Html_message=none): "" "