I am trying to use MAPI to send an email via my VB app. We use GroupWise here and I believe this the root of my problem. Every time I try to run the functionit gets to the mapilogon.UserName and then crashes stating "Object not found". I setup a new profile in the control panel and the specified that in the username and I still get the same error message. Does anyone have any suggestions? Here is my code..

Private Sub email()
Dim strUserId As String
Dim strPassword As String
Dim strfilename As String
Dim strfilepath As String

Screen.MousePointer = vbHourglass

strfilename = "test.pdf"
strfilepath = "h:\"

mapilogon.UserName = "********"
mapilogon.Password = "*******"

mapilogon.SignOn

Do While mapilogon.SessionID = 0
Loop
MAPIMessages1.SessionID = mapilogon.SessionID
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = "Digital Sender"
MAPIMessages1.AddressResolveUI = True
MAPIMessages1.ResolveName
MAPIMessages1.RecipAddress = "smtp:[email protected]"
MAPIMessages1.MsgSubject = "Test" & vbCrLf
MAPIMessages1.MsgNoteText = "Test"
MAPIMessages1.AttachmentPosition = Len(MAPIMessages1.MsgNoteText) - 1
MAPIMessages1.AttachmentPathName = strfilepath & strfilename
MAPIMessages1.Send False
mapipgon.SignOff
MsgBox "File Sent to specified person"

Screen.MousePointer = vbNormal
End Sub