Results 1 to 3 of 3

Thread: sending e-mail with attachments

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    2

    Post

    okay, what i'm trying to do is send email with attachment in VB using the MAPI controls. Here's my code:
    MAPISession1.Action = 1
    MAPIMessages1.SessionID = MAPISession1.SessionID
    MAPIMessages1.Action = 6
    MAPIMessages1.MsgIndex = -1
    MAPIMessages1.MsgSubject = "any title"
    MAPIMessages1.AttachmentPathName = sh$
    MAPIMessages1.RecipDisplayName = "John Doe"
    MAPIMessages1.Action = 2

    Problem is, i always get "unspecified error" but when i remove the attachment everything works fine. Anybody have any ideas? please help, thanks.

  2. #2
    New Member
    Join Date
    Oct 1999
    Posts
    3

    Post

    Hi Sked,

    We have 2 mapi objs - mpmMessage & mpsSession

    Here is a code which works fine for us.

    mpsSession.SignOn
    mpmMessage.SessionID = mpsSession.SessionID
    mpmMessage.Compose
    mpmMessage.RecipAddress = "[email protected]"
    mpmMessage.MsgSubject = "xxxxxx"
    mpmMessage.MsgNoteText = "Thank you"
    mpmMessage.AttachmentPathName = App.Path & "\xxx.txt"
    mpmMessage.Send False

  3. #3
    Lively Member
    Join Date
    Oct 1999
    Posts
    66

    Post

    Does this method also work for binary files???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width