I have a code to automate email. Please help how to attach powerpoint files to the messages. This is my code. It does not attach the ppt to the email. Thank you all. import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication sender_email = "myemail@gmail.com" receiver_email = "to@gmail.com" password = input("Type your password and press enter:") message = MIMEMultipart("alternative") message["Subject"] = "subject" message["From"] = sender_email message["To"] = receiver_email html = """\ <html> <body> <p> email text </font></p> </body> </html> """ text_part = MIMEText(html, "html") pitch_deck = r"path to ppt" with open(pitch_deck, "rb") as ppt: message.attach(MIMEApplication(ppt.read(), Name="file_name")) message.attach(text_part) context = ssl.create_default_context() with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=context) as server: server.login(sender_email, password) server.sendmail( sender_email, receiver_email, message.as_string() ) Continue reading...