Invalid cast error ! While converting Undeliverable mail item as Outlook mail ! Why?

K

ksskumar

Hi friends,

I try to convert a Undeliverable mail (created by Outlook-System
Adminstrator). But the program through the error, "Specified cast is
not valid".

Code sample,

Redemption.SafeMailItem rMailItem = new
Redemption.SafeMailItemClass();
rMailItem.Item = ((Microsoft.Office.Interop.Outlook.MailItem)Connect.oOlMailItems[1]);

This code is working as expected for the normal received mails.

Please any one let me know, what is the problem and how to solve it.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top