当前位置:网站首页>The source code of the live app. When the verification method is mailbox verification, the verification code is automatically sent to the entered mailbox
The source code of the live app. When the verification method is mailbox verification, the verification code is automatically sent to the entered mailbox
2022-07-02 08:14:00 【Cloudleopard network technology】
live broadcast app Source code , When mailbox verification is selected as the verification method , Automatically send the relevant code of the verification code to the entered mailbox
import smtplib
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
# Send multiple types of email
from email.mime.multipart import MIMEMultipart
from PIL import ImageGrab
im = ImageGrab.grab()
im.save('s'+'.png')
msg_from = '[email protected]' # Sender's email
passwd = '66666666666666'
to= ['[email protected]'] # Recipient email
# Set email content
#MIMEMultipart Class can hold anything
msg = MIMEMultipart()
conntent=" This is a string "
# Add in the content
#msg.attach(MIMEText(conntent,'plain','utf-8'))
# Binary read image
image_data=open('1.jpg','rb')
# Set the binary data obtained by reading
message_image = MIMEImage(image_data.read())
# Close the file you just opened
image_data.close()
# Add image files to your email message
#msg.attach(message_image)
# Add attachments
att1=MIMEText(open('result.xlsx','rb').read(),'base64','utf-8') # Open the attachment
att1['Content-Type']='application/octet-stream' # The setting type is streaming media format
att1['Content-Disposition']='attachment;filename=result.xlsx' # Set description information
att2=MIMEText(open('1.jpg','rb').read(),'base64','utf-8')
att2['Content-Type']='application/octet-stream' # The setting type is streaming media format
att2['Content-Disposition']='attachment;filename=1.jpg' # Set description information
msg.attach(att1) # Add to the email
msg.attach(att2)
# Set up email subject
msg['Subject']=" This is the subject of the email "
# Sender information
msg['From']=msg_from
# Start sending
# adopt SSL Mode sending , Server address and port
s = smtplib.SMTP_SSL("smtp.qq.com", 465)
# Login mailbox
s.login(msg_from, passwd)
# Start sending
s.sendmail(msg_from,to,msg.as_string())
print(" Mail sent successfully ")
The above is the live broadcast app Source code , When mailbox verification is selected as the verification method , Automatically send the relevant code of the verification code to the entered mailbox , More content welcome to follow the article
边栏推荐
- Matlab-其它
- 常量指针和指针常量
- How gensim freezes some word vectors for incremental training
- Prompt 范式简述
- Animation synchronization of CarSim real-time simulation
- Replace self attention with MLP
- JVM instructions
- E-R draw clear content
- 多站点高可用部署
- Summary of solving the Jetson nano installation onnx error (error: failed building wheel for onnx)
猜你喜欢

11月24号,我们为“满月”庆祝

St-link connection error invalid ROM table of STM32 difficult and miscellaneous diseases

Opencv3 6.3 reduced pixel sampling with filters

简易打包工具的安装与使用

Replace convolution with full connection layer -- repmlp
![[learning notes] matlab self compiled Gaussian smoother +sobel operator derivation](/img/f1/4afde3a4bf01254b3e3ff8bc659f9c.png)
[learning notes] matlab self compiled Gaussian smoother +sobel operator derivation

应对长尾分布的目标检测 -- Balanced Group Softmax

Embedding malware into neural networks

Array and string processing, common status codes, differences between PHP and JS (JS)
![[learning notes] numerical differentiation of back error propagation](/img/1c/e28e31d7cc5ccc38607c7839ccc5f0.png)
[learning notes] numerical differentiation of back error propagation
随机推荐
Opencv3 6.3 reduced pixel sampling with filters
Global and Chinese market of wire loop, 2022-2028: Research Report on technology, participants, trends, market size and share
St-link connection error invalid ROM table of STM32 difficult and miscellaneous diseases
W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
Use C language to receive JSON strings
Use of opencv3 6.2 low pass filter
Where do you find the materials for those articles that have read 10000?
Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
業務架構圖
OpenCV 6.4 中值滤波器的使用
In the era of short video, how to ensure that works are more popular?
Brief introduction of prompt paradigm
On the back door of deep learning model
[learning notes] numerical differentiation of back error propagation
Rhel7 operation level introduction and switching operation
Carsim 学习心得-粗略翻译1
深入理解JVM
Eklavya -- infer the parameters of functions in binary files using neural network
[C # note] the data in DataGridView saved in WinForm is excel and CSV
Learn to write article format