MAPI Question

roger
09-06-2001, 10:25 AM
Hi, I'm trying to use MAPI Controls to automate sending emails.
The computers that the app will be installed on have outlook and there are two profiles, the first is personal mailbox, and the second is global which the application should use to send the emails.
The following is the code I used. But I get an error 32003 "Login has failed" upon send statement.

mapiSes.DownLoadMail = False
mapiSes.LogonUI = False
mapiSes.username = username
mapiSes.Password = Password
mapiSes.SignOn
If mapiSes.SessionID = 0 Then
MsgBox "ERROR"
End If
mapiSes.NewSession = True
mapiMsg.SessionID = mapiSes.SessionID
mapiMsg.MsgIndex = -1 ' set -1 compose event to work
mapiMsg.Compose
mapiMsg.AddressResolveUI = False
mapiMsg.MsgSubject = "TEST"
mapiMsg.MsgNoteText = "TEST"
mapiMsg.RecipIndex = 0
mapiMsg.RecipType = 1
mapiMsg.RecipAddress = "username@email.com"
mapiMsg.ResolveName
mapiMsg.Send ---> ERROR Occurs HERE
mapiSes.SignOff
--------------------------------------------------
mapiSes and mapiMsg are mapi Controls.
I get "Error 32003 -- Login has Failed." in the Send statement.
Can someone help me out here. I need help ASAP.
Thanks Guys.
Roger


"Great Ideas need Landing Gears as well as Wings"

roger
09-06-2001, 10:59 AM
Now I get a different error msg, Error 32002 "Unspecified Error has occurred" in the same line.

Please help
Roger

"Great Ideas need Landing Gears as well as Wings"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum