MSMAPI32 and Outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've developed an application that uses the MSMAPI32 OCX to send an e-mail through the default e-mail client application

Here is the code

----------------------

axMAPISession1.SignOn()
axMAPIMessages1.SessionID = axMAPISession1.SessionID
axMAPIMessages1.Compose()
axMAPIMessages1.AttachmentPathName = attachfilename
axMAPIMessages1.Send(true)
axMAPISession1.SignOff()

----------------------

Everything works perfectly with Outlook Express (and Netscape Mail), while with Outlook I get the following error message

----------------------

************** Exception Text *************
System.Runtime.InteropServices.COMException (0x800A7D02): Unspecifie
Failure has occurre
at MSMAPI.IMapiMessages.Send(Object vDialog
at AxMSMAPI.AxMAPIMessages.Send(Object vDialog
at MyCalc.Form1.SendReportByMail(
at MyCalc.Form1.btMail_Click(Object sender
EventArgs e
at System.Windows.Forms.Control.OnClick(EventArgs e
at System.Windows.Forms.Button.OnClick(EventArgs e
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButton
button, Int32 clicks
at System.Windows.Forms.Control.WndProc(Message& m
at System.Windows.Forms.ButtonBase.WndProc(Message& m
at System.Windows.Forms.Button.WndProc(Message& m
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg
IntPtr wparam, IntPtr lparam

----------------------

I've found out that the problem is given by the instruction that attaches a file to the e-mail message
axMAPIMessages1.AttachmentPathName = attachfilename

Can anybody help me

Thanks

Ma
 
Back
Top