J
Jorgen Due
Hi all
I have read about half the internet trying to solve this problem.
My problem is, on outlook 2003, how to get the smtp address from the sender og a email when the address returned is a x400 exchange address.
There are a lot of documentation on redemption and VB, but I use C# and have some problems porting the VB samples to C#
here are some of my code.:
string SMTPAddress = "";
int PrSMTPAddress = 0x39FE001E; // not in cache-mode
Outlook.MailItem mailItem = mail as outlook.MailItem;
Redemption.MAPIUtils mapiUtils = new Redemption.MAPIUtils();
if (mailItem.SenderEmailAddress != null)
{
SMTPAddress = mailItem.SenderEmailAddress.ToString();
if(SMTPAddress.StartsWith("/"))
{
SMTPAddress = (string)mapiUtils.HrGetOneProp(mailItem.Recipients[1].Addres sEntry.MAPIOBJECT, PrSMTPAddress);
//this returns my own SMTP address - not the sender!!!
I know that I am doing something wrong, but does anyone have a solution i would be a happy man - again..
Best regards, jorgen
I have read about half the internet trying to solve this problem.
My problem is, on outlook 2003, how to get the smtp address from the sender og a email when the address returned is a x400 exchange address.
There are a lot of documentation on redemption and VB, but I use C# and have some problems porting the VB samples to C#
here are some of my code.:
string SMTPAddress = "";
int PrSMTPAddress = 0x39FE001E; // not in cache-mode
Outlook.MailItem mailItem = mail as outlook.MailItem;
Redemption.MAPIUtils mapiUtils = new Redemption.MAPIUtils();
if (mailItem.SenderEmailAddress != null)
{
SMTPAddress = mailItem.SenderEmailAddress.ToString();
if(SMTPAddress.StartsWith("/"))
{
SMTPAddress = (string)mapiUtils.HrGetOneProp(mailItem.Recipients[1].Addres sEntry.MAPIOBJECT, PrSMTPAddress);
//this returns my own SMTP address - not the sender!!!
I know that I am doing something wrong, but does anyone have a solution i would be a happy man - again..
Best regards, jorgen