Python Forum
Unable to fetch Outlook Mail body
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to fetch Outlook Mail body
#1
Hi All,

This is my second post.So here is issue.

I have a script code where fetching the data from outlook. i am able to get [ReceivedTime,EntryID].
But i am unable to get HTMLBody data. I do not know where is the problem is coming. Plz help me out this problem.
I am showing my code as well as error which i am getting.


]import win32com.client, sqlite3
from datetime import datetime

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
for  message in messages:
    print(message.HTMLBody)
Error:
Traceback (most recent call last): File "C:/C drive/Python/test.py", line 9, in <module> print(message.HTMLBody) File "C:\Users\pramod.singh\AppData\Roaming\Python\Python36\site-packages\win32\com\client\dynamic.py", line 577, in __getattr__ ret = self._oleobj_.Invoke(retEntry.dispid, 0, invoke_type, 1) win32.types.com_error: (-2147467260, 'Operation aborted', None, None)
Reply


Messages In This Thread
Unable to fetch Outlook Mail body - by pramodb35 - Jul-25-2018, 07:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Thumbs Up Convert word into pdf and copy table to outlook body in a prescribed format email2kmahe 1 705 Sep-22-2023, 02:33 PM
Last Post: carecavoador
  Search Outlook Inbox for set of values cubangt 1 975 Jun-28-2023, 09:29 PM
Last Post: cubangt
  Save image from outlook email cubangt 1 649 Jun-07-2023, 06:52 PM
Last Post: cubangt
  Mark outlook emails as read using Python! shane88 2 6,451 Feb-24-2022, 11:19 PM
Last Post: Pedroski55
  Trying out the parsing/reading of emails from my outlook cubangt 0 6,053 Jan-12-2022, 08:59 PM
Last Post: cubangt
  Need Outlook send email code using python srikanthpython 3 8,092 Feb-28-2021, 01:53 PM
Last Post: asyswow64
  Mail issue Mihil 3 2,589 Dec-03-2020, 05:25 AM
Last Post: Mihil
  Outlook Emails & HTML Table in Message Body JoeDainton123 1 11,224 Sep-02-2020, 05:15 AM
Last Post: buran
  reading shared outlook emails zarize 0 2,423 Mar-03-2020, 01:47 PM
Last Post: zarize
  Zeep lib, encrypt soap body miha1234 0 2,816 Sep-12-2019, 07:52 AM
Last Post: miha1234

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020