MAPI control with C# causes exception when calling Send()

D

Drew

Real simple code:

MSMAPI.MAPISessionClass session = new MSMAPI.MAPISessionClass();

session.SignOn();

if (session.SessionID != 0)
{
MSMAPI.MAPIMessagesClass message = new MSMAPI.MAPIMessagesClass();
message.SessionID = session.SessionID;

message.Compose();

message.RecipType = (short)MSMAPI.RecipTypeConstants.mapToList;
message.RecipAddress= "(e-mail address removed)";
message.MsgSubject = issue.Type;
message.MsgNoteText = issue.Description;

message.Send(true);

session.SignOff();
}

When my default client is Outlook Express, it works fine. When I change
my default client to Outlook, I get this exception:

An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in
IssueReporter.exe

Additional information: Unspecified Failure has occurred

I had this same code running in managed C++. Anyone know of any fixes
for C#?
 
C

Christoph Nahr

MSMAPI and the other stuff is not anything I recognize. You should
ask that question to whoever developed that library, or possibly to
the Microsoft team that owns Outlook and Outlook Express.
 

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