MAPI control with C# causes exception when calling Send()
- From: "Drew" <drewtenn@xxxxxxxxx>
- Date: 15 Jul 2005 10:31:57 -0700
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= "email@xxxxxxxxxxx";
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#?
.
- Follow-Ups:
- Re: MAPI control with C# causes exception when calling Send()
- From: Christoph Nahr
- Re: MAPI control with C# causes exception when calling Send()
- Prev by Date: Re: Pass external delegate to a class constructor.
- Next by Date: overriding static and non static method
- Previous by thread: how do i create a generic method for opening forms?
- Next by thread: Re: MAPI control with C# causes exception when calling Send()
- Index(es):
Relevant Pages
|
Loading