Could anyone suggest a reason that my VB code to send an email invokes Outlook Express correctly the first time through, but thereafter either sends the emails to Outlook instead or gives the error 32002. The emails do have an attachment; I know about msgtext needing to be a non-zero length string in this case.
VB and MAPI
Collapse
X
-
Perhaps you could tell us what VB version you're using, and maybe show us the code?Originally posted by ANNSTCould anyone suggest a reason that my VB code to send an email invokes Outlook Express correctly the first time through, but thereafter either sends the emails to Outlook instead or gives the error 32002. The emails do have an attachment; I know about msgtext needing to be a non-zero length string in this case. -
I am using VB6 and Windows XP. I sort of think it may be something to do with my default mail options in Windows... ??? The code I am using is straight out of the VB6 Help:
'establish a mapi session
With mapSession
.DownLoadMail = False
.LogonUI = True
If .SessionID = 0 Then .SignOn
mapMessage.Sess ionID = .SessionID
End With
'compose & send message
With mapMessage
.MsgIndex = -1
.Compose
.RecipAddress = txtEmailTo
.RecipDisplayNa me = txtEmailTo
.MsgSubject = txtSubject
.MsgNoteText = txtMsg
.Send
End WithComment
Comment