Take this example:
df_1 = ([1,2,3,5])
df_2 = ([10,20,30,50])
df_test =pd.concat([pd.DataFrame(df_1),pd.DataFrame(df_2)],axis=1)
How can I send an email, via gmail, with this dataframe to look like a table?
This is what I tried:
import smtplib
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(fromaddr , ".......")
msg = df_test.to_html()
server.sendmail(fromaddr, toaddr, msg)
server.quit()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…