Feature Requests item #3023833, was opened at 2010-07-01 16:19
Message generated for change (Settings changed) made by hvbargen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551957&aid=3023833&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: com
Group: None
Status: Open
Resolution: None
>Priority: 3
Private: No
Submitted By: H. von Bargen (hvbargen)
Assigned to: Nobody/Anonymous (nobody)
Summary: MAPI support for PR_REPLY_RECIPIENT_ENTRIES
Initial Comment:
I was able to replace most of my existing C++ based sendmail.exe program with a Python script using pythoncom.mapi.
Great work!
However, I am not able to specify a different Reply-To address, because the mapi package does not support the FLATENTRY and FLATENTRYLIST structures.
Note: Working C++ code for specifying a different Reply-To address can be found at http://support.microsoft.com/kb/300531
----------------------------------------------------------------------
>Comment By: H. von Bargen (hvbargen)
Date: 2010-07-02 11:35
Message:
OK, as a workaround it is possible to modify the reply-to address with a
bit low-level code (see below). So, my problem is solved. Anyway, perhaps
this could be a nice addition to the mapiutil package.
code fragment to set the replyTo-Address
def makeentry(typ, name_addr):
return ((mapitags.PR_RECIPIENT_TYPE, typ),
#(mapitags.PR_DISPLAY_NAME_A, name_addr),
(mapitags.PR_DISPLAY_NAME_W, name_addr),
)
# ReplyTo-Address
if replyTo:
# replyTo is a unicode string
replyToList = address_book.ResolveName(0, mapi.MAPI_UNICODE, None,
[makeentry(mapi.MAPI_TO, replyTo)])
props = [(mapitags.PR_REPLY_RECIPIENT_NAMES, replyTo),
]
message.SetProps(props)
replyToAddr = replyToList[0]
for (pt, pv) in replyToAddr:
if pt == mapitags.PR_ENTRYID:
entryid = pv
break
#print "reply-to entryid (len %s): %r" % (len(entryid), entryid)
flatentry = struct.pack("i", len(entryid)) + entryid
#print "flatentry:", repr(flatentry)
flatentrylist = struct.pack("ii", 1, len(flatentry)) + flatentry
props = [
(mapitags.PR_REPLY_RECIPIENT_ENTRIES, flatentrylist),
]
message.SetProps(props)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551957&aid=3023833&group_id=78018
|