Questions tagged [exchangelib]

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).

See also

235 questions
3
votes
1 answer

after generated .exe using pyinstaller it give me error (no module named exchangelib)

I am writing python code to fetch inbox mails using credentials and I am using exchangelib and importing some modules but when I generate .exe file using pyinstaller it give me this error after run the .exe file (ModuleNotFoundError : No module…
hesham ahmed
  • 141
  • 1
  • 10
3
votes
1 answer

exchangelib - How to send attachment with email reply

I am using exchangelib to connect to exchange and reply to emails. But while sending reply it doesn't support attachments. As per this answer I have to " create a normal Message item that has a 'Re: some subject' title, contains the attachment, and…
mry
  • 314
  • 2
  • 11
3
votes
1 answer

Trying to return emails within past 24 hours using ExchangeLib

I'm trying to use ExchangeLib to return all emails within an inbox within the past 24 hours. I currently have it set up to return the most recent email in the inbox, I just need help with the 24 hours part. Here is what I have so far: credentials =…
JK72
  • 149
  • 1
  • 8
3
votes
2 answers

Attempting to delete multiple email messages in folder outside of inbox with Python and Exchangelib

I'm trying to delete all email messages in a folder outside of my account.inbox with Python 3 and exchangelib. testFolder = account.root / 'Top of Information Store' / 'Test' emails = testFolder.all().order_by('-datetime_received') for email in…
3
votes
1 answer

SSL: CERTIFICATE_VERIFY_FAILED when connecting to a company Exchange Server

I try to send mails from out company exchange server via Python. My problem is, that I get a SSL error. I read a lot of pem-, cer-, crt-files, but I can not connect all these information to have success. I am sure, that if one can fix the issue in…
Erik Steiner
  • 581
  • 1
  • 5
  • 18
3
votes
2 answers

Python: Convert email address list to send email

I have email address list as below: email_list = [a@gmail.com, b@gmail.com, c@gmail.com] I converted with below: email_string = ''.join(str(e) for e in email_list) But I got emails are a@gmail.com b@gmail.com c@gmail.com which can not be received…
Elsa
  • 1
  • 1
  • 8
  • 27
3
votes
2 answers

Python exchangelib read mails in subfolder

I want to read the mails from the subfolder of the outlook mailbox. Inbox ├──myfolder I can read Inbox using account.inbox.all() but i want to read mails in myfolder I tried the things in folder section of this page but i couldn't get it…
rdm_
  • 67
  • 1
  • 8
3
votes
1 answer

Exchangelib Python extracting emails as HTML but I want plain text

I am new to getting emails in Python except for using things for ArcGIS. However, I have been assigned a task to continuly look at an email address for an incoming email with a paticular subject and to extract just a few things from that email. I…
user38508
  • 31
  • 1
  • 3
3
votes
1 answer

How can I run an email listener with exchangelib that triggers when a new mail is received?

I want to write a service that takes a message from my outlook account. For connection to outlook, I used exchangelib but I didn't find how to run listener for incoming emails. Here is my code. from exchangelib import DELEGATE, Account,…
Artem Kryvonis
  • 128
  • 2
  • 13
2
votes
2 answers

Marking an email as read python

I'd like to mark an email as read from my python code. I'm using from exchangelib import Credentials, Account my_account = Account(...) credentials = Credentials(...) to get access to the account. This part works great. I then get into my desired…
2
votes
2 answers

'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

When using this code, the following error is generated: exchangelib.errors.TransportError: HTTPSConnectionPool(host='mail.rt.yu', port=443): Max retries exceeded with url: /EWS/Exchange.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL:…
ashraf saleh
  • 23
  • 1
  • 1
  • 4
2
votes
0 answers

How to use Microsoft Online Exchange with python to send mail

I want to send an Email from my outlook account using Python. I used the below code running in an AWS EC2 instance to generate an email. import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart server =…
Vipendra Singh
  • 689
  • 2
  • 12
  • 26
2
votes
0 answers

Fixing ImportError: DLL load failed: The specified procedure could not be found. for conda installed exchangelib in virtual environment

I am using Python version 3.7.9 installed using anaconda. I want to use the exchangelib package. I installed it using conda install: conda install -c conda-forge exchangelib However, when I try to import exchangelib into a Python script, using the…
Brandon
  • 55
  • 3
2
votes
1 answer

Python exchangelib OAuth2 authentication failing

Since Microsoft has apparently EOL'd basic authentication for Exchange Web Services, I'm trying to convert my Python app to use OAuth2. Python 3.8, exchangelib 3.2.1, ms-exchange version unknown but recent. Relevant code follows: from exchangelib…
Rich H
  • 21
  • 1
  • 4
2
votes
1 answer

How to embed an image in the body of an email using exchangelib library python

I need to embed multiple images into an email's body. I have tried below code but it does not embed it to the email's body. I am not looking to make it as an attachment with open(i, 'rb') as f: my_logo = FileAttachment( name=i, …
Jonathan Lam
  • 1,237
  • 3
  • 20
  • 49
1
2
3
15 16