VB and MAPI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ANNST
    New Member
    • Aug 2007
    • 2

    #1

    VB and MAPI

    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.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by ANNST
    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.
    Perhaps you could tell us what VB version you're using, and maybe show us the code?

    Comment

    • ANNST
      New Member
      • Aug 2007
      • 2

      #3
      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 With

      Comment

      Working...