My input file is a CSV file and by running some python script which consists of the python Tabulate module, I have created a table that looks like this below:-
| Attenuation | Avg Ping RTT in ms | TCP UP |
|---------------:|---------------------:|---------:|
| 60 | 2.31 | 106.143 |
| 70 | 2.315 | 103.624 |
I would like to send the this table in the email body and not as an attachment using python.
I have created a sendMail function and will be expecting to send the table in the mail_body.
sendMail([to_addr], from_addr, mail_subject, mail_body, [file_name])
This code sends the message in the typical plain text plus html multipart/alternative format. If your correspondent reads this in an html-aware mail reader, he's see the HTML table. If he reads it plain-text reader, he'll see the plain text version.
In either case, he will see the data included in the body of the message, and not as an attachment.