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
1 answer
Executing batch operations on mulitiple Items using exchangelib
I am looking for a way to apply same actions on multiple Items, example Messages with a single call. Example, I retrieve a set of Messages using a search filter. After this I would want to delete the messages that matched the criteria. Currently, I…

codeoverflow
- 71
- 1
- 5
0
votes
1 answer
Python exchangelib support multiple strings for filter path subject
I'm trying to search for emails with multiple subjects, but it only supports a single subject string in my code. I also want it to print if there is a missing subject in the search.
if not testfolder.filter(
datetime_received__gt=since,
…

Farzad mirzaii
- 17
- 6
0
votes
1 answer
Python exchangelib create alert if no email is found the past 24 hours
How can I make an alert/exception, if an email isn't found the past 24 hours?
This is the printed output, if there is an email found. It prints the email-address, subject and count. In one line
defaultdict(, {('info@something.com',…

fazzerking
- 23
- 7
0
votes
0 answers
Python exchangelib raise ValueERROR datetime_received
I'm trying to check how many emails have been received from the specified sender.email_address the past 24 hours, but I get an error from this code
Traceback (most recent call last):
File "c:/Users/fmi/Desktop/Python/emailtest.py", line 13, in
for…

fazzerking
- 23
- 7
0
votes
2 answers
Python loop not iterating through the list
I have this code, where I'm trying to loop through a mailbox with specified email-adresses in a list, but instead I'm getting the output of all email-adresses. When I print the counts, I get like 10 different email adresses, but not the ones I've…
0
votes
1 answer
Trying to print amount of recieved emails from a specific email adress
I'm working with some code in python with the exchangelib library, I'm trying to print a list of specific email addresses with a counter that counts the amount of emails recieved from that emailaddress. This is my code, but I'm not getting any…

Farzad Henareh
- 21
- 8
0
votes
1 answer
Certificate verification when using NoVerifyHTTPAdapter
I have some code that uses Exchangelib to process emails. For various reasons, the certificate validation fails and I have to use the usual NoVerifyHTTPAdapter:
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
# Tell exchangelib to…

Dataguy
- 3
- 2
0
votes
1 answer
Reading the local date and time on the email in python using exchangelib
I am using exchangelib to process emails in python.
When I execute the following code,Iget UTC datetime.How can I get the local date and time of the emails received as per the local timezone?
for email_message in outlook_inbox: #outlook_inbox is…

TLanni
- 330
- 1
- 4
- 15
0
votes
0 answers
Unable to query other people's calendars in exchangelib
I'm trying to access the calendar of other users via:
account = Account(
primary_smtp_address=user,
autodiscover=False,
config=config,
access_type=DELEGATE
)
items = account.calendar.filter(start__range=(start_date,…

agermain
- 122
- 11
0
votes
0 answers
Exchangelib TLS Configuration
I have been trying to access a mailbox within my Organisation's exchange server with the following code :
from exchangelib import Credentials, Account, DELEGATE, Configuration,NTLM, IMPERSONATION,…

Diptarka
- 3
- 5
0
votes
0 answers
Decoding an Excel file in email inbox
I have a mystery as to why one type of excel file will decode but the other will not. Here is what the two different files come in as:
File that works
File that doesn't work
The only difference that I can see is that one comes in with _content…

Andrew Marotta
- 47
- 7
0
votes
0 answers
Accessing Shared Mailbox Using Exchangelib — Python
Trying to Access a Shared Folder using the following code :
credentials = Credentials(username = user_name, password = "secret")
config = Configuration(server ='outlook.office365.com', credentials = credentials, auth_type=NTLM)
account =…

Diptarka
- 3
- 5
0
votes
1 answer
Access email from a particular folder in Outlook, within a specific date range (user Input) using "exchangelib" in Python
Summary of the requirement :
To access emails from a specific folder in Outlook within a user given date range,
ex: all mails from June or all mails from 23-June-2020 to 15-July-2020
So far we have tried the following but the issues are :
Date…

Diptarka
- 3
- 5
0
votes
2 answers
Saving file with a name containing / at the destination folder in python
I am saving emails from outlook to the local folder.Folder path is following.
folder_path=r"C:\Documents\emails
filename is the subject of the email message as the following
subject=email_message.subject
so the final_path will…

TLanni
- 330
- 1
- 4
- 15
0
votes
2 answers
Exchangelib: ItemAttachment appears to strip file extension from the attachment name
While trying to handle couple attachments of types ItemAttachment and FileAttachment from an inbound email, I notice that the ItemAttachment (representing an email attachment "HELLO WORLD.eml") strips the extension .eml from the name. So I lose that…

RajSoundar
- 341
- 1
- 2
- 8