Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I'm creating a service that connects to Outlook 2003. I'm getting a problem when I start the service and it tries to connect to the Exchange Server. When I debug it, it works everytime. When I start it as a service, it fails every time. I know that the code is correct as it lets me connect when debugging.

 

Please can anyone help or at least shed some light on this?

Posted
What user account is the service running as? Does this account have access to the Exchange server?

 

I'm using my own log in which has an Exchange Account. It is connecting correctly to the account and even works when I try and debug it, but it seems to fail when it tries to get the sender email address.

 


Private objMessage As Outlook.MailItem

Public Sub ProcessEmails()

[indent]objMessage = objFolder.Items(1)[/indent]


[indent]'Get the sender email address[/indent]


[indent]Dim strSender As String = objMessage.SenderEmailAddress[/indent]


[indent]'rest of the sub ....[/indent]

End Sub

 

It fails on the Dim strSender line. It sets the message object correctly, but as soon as it does anything else with objMessage it fails completely. Any ideas?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...