Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to simulate login and send QQ mail to QQ Mail

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use Python to achieve simulated login QQ mailbox to send QQ mail", in daily operation, I believe many people in how to use Python to achieve simulated login QQ mailbox to send QQ mail problems have doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "how to use Python to achieve simulated login QQ mailbox to send QQ mail" doubts help! Next, please follow the small series to learn together!

Attach the code first

from email.mime.text import MIMETextfrom email.header import Headerfrom smtplib import SMTP_SSL#qq mailbox smtp server host_server = 'smtp.qq.com'#sender_qq is the qq number of sender_qq = '3723358***'#pwd is the authorization code of qq mailbox pwd = '**iao**lxpic**'#sender's mailbox sender_qq_mail = '3723358**@qq.com'#mailbox <$receiver = 'thunder <$$><$@ gmail.com'#recipient's mail_content = 'hello, I'm from Zhihu [Deng Xudong], HIT Now we are doing a test of logging in qq mailbox with python to send mail '#mail title = ' Deng Xudong HIT mail '#ssl login smtp = SMTP_SSL(host_server)#set_debuglevel() is used for debugging. parameter value of 1 means to enable debugging mode, parameter value of 0 means to disable debugging mode smtp.set_debuglevel(1)smtp.ehlo(host_server)smtp.login(sender_qq, pwd)msg = MIMEText(mail_content, "plain", 'utf-8') msg["Subject"] = Header(mail_title, ' utf-8') msg["From"] = sender_qq_mailmsg["To"] = receiversmtp.sendmail(sender_qq_mail, receiver, msg.as_string())smtp.quit() Here, about "how to use Python to achieve simulated login QQ mailbox to send QQ mail" learning is over, I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report