1

How can I change the property SenderName and SenderEmailAddress in a .msg file, not from within Outlook?

I know that this is not possible with the Outlook COM, because it is a read only property.

I tried using the class Redemption.RDOSession and the method GetMessageFromMsgFile but all the properties were null.

Community
  • 1
  • 1
Nuno
  • 126
  • 2
  • 14

1 Answers1

2

Sure, it is very easy:

string rdoAddressID = rdoSession.CreateOneOffEntryID("Joe the User", "SMTP", "address@email.com", Type.Missing, Type.Missing);
Redemption.RDOAddressEntry entry = rdoSession.GetAddressEntryFromID(rdoAddressID, Type.Missing);
mail.Sender = entry;
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • this also adds the "send on behalf of" after the email address. Do you know how can I remove this ? Tnks – Nuno May 07 '18 at 22:02
  • 1
    Never mind. I got it. Need to had the same entry to the SendOnBehalfOf property. Thanks – Nuno May 07 '18 at 22:39