Bottom Page

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)
buran wrote Jul-25-2018, 08:05 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Zeep lib, encrypt soap body miha1234 0 115 Sep-12-2019, 07:52 AM
Last Post: miha1234
  Reading email messages on Outlook johnjohn 9 14,761 Apr-03-2019, 10:41 AM
Last Post: Ken2702
  Add png to the body of the email, not the attachment Ivan87 8 677 Dec-14-2018, 11:05 AM
Last Post: wavic
  How to Find a specific email in Outlook with Python Code jassi123 2 777 Oct-31-2018, 08:07 AM
Last Post: jassi123
  [Outlook] How to delete items from To-Do List? Winfried 1 508 Oct-19-2018, 09:05 PM
Last Post: nilamo
  get email text body: very close but I can't get it [SOLVED} Pedroski55 5 2,485 Oct-07-2018, 11:38 AM
Last Post: j.crater
  Rigid Body Simulation in 3D with constraints FumingElephant 1 552 Jul-11-2018, 02:16 AM
Last Post: Larz60+
  How to iterate a PlainLocationField object and fetch some values? PrateekG 9 1,061 Jun-21-2018, 08:49 AM
Last Post: wavic
  How to read and save specific outlook email into csv Prince_Bhatia 0 2,457 May-03-2018, 05:03 AM
Last Post: Prince_Bhatia
  Read or save email in Outlook 2013 rolan 1 788 Apr-06-2018, 09:57 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)