email-attachments

Viewing content of outlook attachment in python

Viewing content of outlook attachment in python Question: I’m trying to use python to get some data that is in an attachment on an outlook email and then use that data in python. I’ve managed to write the code that will get into the outlook inbox and folder I want and then get the attachments …

Total answers: 2

Why is this throwing an exception when I try to save the attachment from Outlook?

Why is this throwing an exception when I try to save the attachment from Outlook? Question: I am trying to iterate through the contents of a subfolder, and if the message contains an .xlsx attachment, download the attachment to a local directory. I have confirmed all other parts of this program work until that line, …

Total answers: 1

Python sends bulk mail from [BCC] insted of [TO], why?

Python sends bulk mail from [BCC] insted of [TO], why? Question: I am writing a python script that sends every day a bulk email (connected to an outlook.com account) with the body of a news website as an ebook to multiple kindle accounts (that have already whitelisted this outlook account). This was working so far, …

Total answers: 1

'Cannot save the attachment' error when retrieving Outlook email

'Cannot save the attachment' error when retrieving Outlook email Question: As of today I am receiving an error when attempting to save email attachments from Outlook using Python and win32com library. This was previously working however since modifying the code to get only the latest emails, the attachments are no longer being saved to the …

Total answers: 1

Python Sendgrid send email with PDF attachment file

Python Sendgrid send email with PDF attachment file Question: I’m trying to attach a PDF file to my email sent with sendgrid. Here is my code : sg = sendgrid.SendGridAPIClient(apikey=os.environ.get(‘SENDGRID_API_KEY’)) from_email = Email(“[email protected]”) subject = “subject” to_email = Email(“[email protected]”) content = Content(“text/html”, email_body) pdf = open(pdf_path, “rb”).read().encode(“base64”) attachment = Attachment() attachment.set_content(pdf) attachment.set_type(“application/pdf”) attachment.set_filename(“test.pdf”) attachment.set_disposition(“attachment”) attachment.set_content_id(number) …

Total answers: 5

Send attached file with Mailgun using python

Send attached file with Mailgun using python Question: I’m trying to send an email with an attached file with the Mailgun API using requests.post. In their documentation they alert that you must use multipart/form-data encoding when sending attachments, I’m trying this: import requests MAILGUN_URL = ‘https://api.mailgun.net/v3/sandbox4f…’ MAILGUN_KEY = ‘key-f16f497…’ def mailgun(file_url): “””Send an email using …

Total answers: 1