Hi ,<br><br>This code can read the content of mails body , html and headers from outlook.<br>in case , it there's an embedded image, <br>Its not getting the image,<br><br>My code.......<br><br>def GetPropFromStream(mapi_object,prop_id):
<br> try:<br> stream = mapi_object.OpenProperty(prop_id,<br> pythoncom.IID_IStream,<br> 0, 0)<br> chunks = []
<br> while 1:<br> chunk = stream.Read(4096)<br> if not chunk:<br> break<br> chunks.append(chunk)<br> return "".join(chunks)<br>
except pythoncom.com_error, d:<br> print "Error getting property", mapiutil.GetPropTagName(prop_id), \<br> "from stream:", d<br> return ""<br><br><br>
def GetPotentiallyLargeStringProp(mapi_object,prop_id,row):<br> got_tag,got_val = row<br> if PROP_TYPE(got_tag) == PT_ERROR:<br> ret = ""<br> if got_val == mapi.MAPI_E_NOT_FOUND:
<br> pass # No property for this message.<br> elif got_val == mapi.MAPI_E_NOT_ENOUGH_MEMORY:<br> # Too big for simple properties - get via a stream<br> ret =GetPropFromStream(mapi_object,prop_id)
<br> else:<br> tag_name = mapiutil.GetPropTagName(prop_id)<br> err_string = mapiutil.GetScodeString(got_val)<br> print "Warning - failed to get property %s: %s" % (tag_name,err_string)
<br> else:<br> ret = got_val<br><br><br>prop_ids = (PR_BODY_A,MYPR_BODY_HTML_A,PR_TRANSPORT_MESSAGE_HEADERS_A)<br>hr,data=obj.GetProps(prop_ids,0)<br>body = GetPotentiallyLargeStringProp(obj,prop_ids[0],data[0])
<br>html = GetPotentiallyLargeStringProp(obj,prop_ids[1],data[1])<br>headers =GetPotentiallyLargeStringProp(obj,prop_ids[2],data[2])<br><br>can anybody tell me ,<br><br>how can i get the images?<br><br>Antony<br><br><br><br>
<br>