PDA

Click to See Complete Forum and Search --> : sending e-mail with attachments


Sked
Oct 12th, 1999, 08:46 AM
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.

RajSatish
Oct 12th, 1999, 07:06 PM
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 = "xxx@xyz.com"
mpmMessage.MsgSubject = "xxxxxx"
mpmMessage.MsgNoteText = "Thank you"
mpmMessage.AttachmentPathName = App.Path & "\xxx.txt"
mpmMessage.Send False

Bart
Oct 15th, 1999, 03:22 PM
Does this method also work for binary files???