This project has moved. For the latest updates, please go here.

Can't Send email when outlook is not running.

Oct 19, 2015 at 9:04 AM
Edited Oct 19, 2015 at 9:05 AM
am trying to run the sample for outlook, sample works perfectly.
\NetOffice 1.7.4\NetOffice 1.7.4\NET 4.0\Examples\Outlook\C#\Standard Examples

When the outlook is opened and running, i can send email from the Test Example.

But when the outlook is not running, am getting the below exception
{"Exception has been thrown by the target of an invocation."}
at NetOffice.Invoker.PropertyGet(COMObject comObject, String name, Object[] paramsArray) in C:\NetOffice10\Source\NetOffice\Invoker.cs:line 780
at NetOffice.OutlookApi._MailItem.get_Recipients() in C:\NetOffice10\Source\Outlook\DispatchInterfaces_MailItem.cs:line 1027
at OutlookExamplesCS4.Example03.buttonStartExample_Click(Object sender, EventArgs e) in d:\NET OFFICE\NetOffice 1.7.4\NetOffice 1.7.4\NET 4.0\Examples\Outlook\C#\Standard Examples\OutookExamples\Examples\Example03.cs:line 77
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons 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.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at OutlookExamplesCS4.Program.Main() in d:\NET OFFICE\NetOffice 1.7.4\NetOffice 1.7.4\NET 4.0\Examples\Outlook\C#\Standard Examples\OutookExamples\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
  • Windows 8.1 Pro 64 Bit
  • Microsoft office Pro Plus 2010 - 32 Bit