exchangelib is a Python package which provides an interface for communicating with a Microsoft Exchange 2007-2016 Server or Office365 using Exchange Web Services (EWS).
Questions tagged [exchangelib]
235 questions
0
votes
0 answers
Authentication error using OAuth with exchangelib
I am working on a Python based client code to access Microsoft Outlook 365 emails via OAuth2 and get all emails. But when I try to connect with my OAuth credentials, I get an UnauthorizedError.
creds = OAuth2Credentials(
client_id=CLIENT_ID,
…

user2307033
- 1
- 1
0
votes
0 answers
501 Invalid Request
I am using exchangelib for some end-to-end testing purposes of our mail system. Currently, when making a request, I am returned a 501.
# Tell exchangelib to use this adapter class instead of the default
BaseProtocol.HTTP_ADAPTER_CLS =…

Alex Knowlton
- 1
- 1
0
votes
1 answer
how to send pandas dataframe as an email attachment in python using exchangelib
I need to email the pandas dataframe df as an attachment using exchangelib.
below is my code
import io
attachments=[]
x=io.BytesIO(df.to_records(index=False))
content=x.getvalue()
type(content) #bytes
send_email(account, 'Subject', 'test…

TLanni
- 330
- 1
- 4
- 15
0
votes
1 answer
How can I add an email to an existing calendar entry using exchangelib?
I have an existing calendar event already scheduled.
I am trying to add a number of emails to that existing event, but when I run this function it adds a new event.
I need to be able to: find the event, add the specified email to the event, have…

dungan1103
- 23
- 1
- 5
0
votes
0 answers
Forward an incoming OUTLOOK exchangelib message
I need to forward a new incoming message there may be attachments to another address. But the letter doesn't go away. how do I do this?
s = a.inbox.unread_count# количество непрочитанных
if s > 0:
print(s, ' Получено новых писем')
for item…
0
votes
1 answer
Python reading email from outlook account using imaplib/imapclient vs exchangelib?
I am setting up a script to read incoming emails from an outlook.com account and I've tested a few approaches with imaplib and was unsuccessful. Yet when I tried with Exchangelib I was able to do this. I'm not entirely sure why Exchangelib works and…

alex
- 1,905
- 26
- 51
0
votes
1 answer
Python exchangelib recurrence events
I use exchangelib for work with Exchange API. When I try get all events from calendar I don't get recurrence events, only master recurrence event without next occurrences. May be someone know how to get all occurrences. Thanks

ivan
- 30
- 2
0
votes
1 answer
Error "Failed to create cached protocol with key.." when trying to connect to Exchange mail account using python
Good day. I have a python script which checks mailbox for unread messages. If there are unread messages with attachments it then executes some code(excel automation). It used to be working well; however, today I encountered this error while…

Dias
- 51
- 1
- 1
- 4
0
votes
3 answers
Python Connect To Exchange /w Windows Auth
I am trying to create a script in Python 3.8 script that can connect to an Exchange server and retrieve emails from a mailbox. I am trying to authenticate with Exchange by using the currently authenticated user. I can authenticate fine if I use a…

jkruskie
- 412
- 4
- 15
0
votes
1 answer
Exchangelib - How to save the most recent attachment from a specific subject line
I am trying to read and save the most recent email attachments with specific email subject. I know how to filter the email by the subject line OR the receive time. But I don't know how to combine this two requests. Can you please let me know if you…

j.y
- 1
0
votes
1 answer
Unable to save fileattachment into Django Model FileField
I am currently integrating exchange server email to my application. I am able to retrieve attachments from my emails using exchangelib. I am trying to save the attachments into my Django model filefield. However, it is not working with different…

Ang Yang Cheng
- 51
- 7
0
votes
1 answer
What is the correct way to connect to an internal SMTP server using Python and exchangelib
I'm trying to connect to Microsoft Exchange web server using Python and the exchangelib library.
Here is my code (with edited domain, username, password and SMTP server):
from exchangelib import DELEGATE, Configuration, Credentials,…

Typeset
- 26
- 6
0
votes
1 answer
How to get message-id of email reply exchangelib
I need to get the message id of the email sent with exchangelib. I can't find documentation on how to get it.
item = account.inbox.filter(message_id__in=[message_id]).only( 'subject',
…

Luis Sucuc
- 11
- 3
0
votes
2 answers
ImportError: cannot import name 'Message' from 'exchangelib.folders'
I am using Python 3.7 (x64) on a Windows 7 machine. I'm recieving the error message below, but when I did research on similar issues, none of the solutions appeared to relevant. The script is named master_pdf_email.py, and is inside a folder with no…

Ethan Hill
- 478
- 2
- 10
- 24
0
votes
1 answer
Python Read Emails
My teammate uses the above code in C# (.NET) to extract email details from his inbox. If you notice it does not require any credential.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
…

Vasim
- 3,052
- 3
- 35
- 56