Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Sending Email in an NT Service using VB


Message #1 by "Duncan Allen" <dxallen@b...> on Thu, 31 Jan 2002 16:45:10
You have just run up against one of the limitations of VB.  You cannot
use CDO in an NT service.

-----Original Message-----
From: Duncan Allen [mailto:dxallen@b...]
Sent: Thursday, January 31, 2002 11:45 AM
To: professional vb
Subject: [pro_vb] Sending Email in an NT Service using VB


I'm trying to send email using MAPI in an NT Service written in VB using

NTSVC.OCX

I'm getting the following problems.

1. If I use the MSMAPI32.OCX then it all seems to work, but after a
while
the emails start getting held up. When I view the outbox of the MAPI
profile using outlook 2000, all the emails are there. I think I'm
closing
the MAPISession before the message has a chance to be sent, but I can't
find a way of checking that the msg has gone before I close the session
-
msgsent property doesn't seem to work.

2. Using CDO 1.21 library I get the following errors:
a. On a win2000 machine running the nt service under a different account

to the interactive user

Err Number : -2147221231
Err Description :  [Collaboration Data Objects - [MAPI_E_LOGON_FAILED
(80040111)]]

b. On an NT4 machine, again running the nt service under a different
account to the interactive user

Err Number : 430
Err Description : Class does not support automation or does not support
expected interface.

Naturally both methods work fine in the VB IDE !

Is there a fool proof way to send emails from an NT Service using vb
where
the nt service uses a specific account and no-one is logged onto the
machine ?

Thanks for your help !

  Return to Index