MAPI Session Logon Fail when run as windows service

  • Thread starter Thread starter Horace Tang
  • Start date Start date
H

Horace Tang

I'm trying to write a vb program (.exe) to auto send emails (with excel file
as attachment) to an exchange server (which connects to a fax server so that
the excel files can fax out) (I know I need redemption to bypass the outlook
warning message)
However, the program always fails in the Logon method as follows when
running it as windows service (using srvany and srvinstrw)
ObjSession = CreateObject("MAPI.Session")
ObjSession.Logon "MailProfileName", "", False, True <- this generate
E_Logon_failed error

I have set the service startup account as the domain user account which has
the access right to login that "MailProfileName" mail profile but still
fails.
However, if I just excute the program in command prompt, everything is ok
(just that the dialog box prompts for the password for the domain user
account when the workstation is not logon to the domain)
The environment is window2000 pro with sp4, VB6 and outlook 2002 with sp2
(but I'm not sure if the exchange server is 5.5 or 2000)

I have been searching the solutions on the webs for days and all the webs
mentions that the above should be correct, could anyone help?
 
Back
Top