Can setup SMTP inside python itself but for better protection, setup sendmail with SMTP as in other post and then: More focused module : def send_mail ( email , subject , body = "" , dataframe_dict = {}): html_content = "" for name , df in dataframe_dict .items(): html_content += f "<h3> { name } </h3>" html_content += df .to_html( escape = False , classes = 'table table-striped' , table_id = 'dataframe' ) html_content += "<br><br>" styled_html = f """ <html> <body> { body } <br><br><br><br> { html_content } </body> </html> """ # Send HTML email using mail command process = subprocess...