tags:

views:

19

answers:

1

I am using MAPI for opening default email client from my C# application, as similar way in this example

http://www.codeproject.com/KB/IP/SendTo.aspx?df=100&forumid=257922&select=1801097#xx1801097xx

But, is there anyway to define/change from address ?

A: 

The sample uses IntPtr for the originator param, which is really a MapiRecipDesc. Define the managed version of that strucutre (http://msdn.microsoft.com/en-us/library/dd296720%28VS.85%29.aspx), then set ulRecipClass to MAPI_ORIG, and name and address accordingly. If you know the entryId of the 'from'address you want to use, set those also.

skhavari