Using MAPI in VB5
Posted on 1998-11-25
I would really appreciate some help on this one.
I am using MAPIMESSAGE and MAPISESSION controls shipped with VB5 to send emails with attachments at runtime.
The problem I have is to allow multiple files to be attached in the same email. I am not quite sure what to do with regards to the message body being large enough to allow for these attachments. I got he program working by sending each file individually, but because of the speed the emails were going, it is not really a solution.
This is sample of my code (for just one attachment):]
MAPIMess.SessionID = MAPISess.SessionID
MAPIMess.MsgIndex = -1
MAPIMess.RecipDisplayName = somename
MAPIMess.AddressResolveUI = True
MAPIMess.MsgReceiptRequested = True
MAPIMess.AttachmentIndex = MAPIMess.AttachmentCount
MAPIMess.AttachmentName = "file.txt"
MAPIMess.AttachmentPathName = "c:\file.txt"
MAPIMess.AttachmentPosition = MAPIMess.AttachmentIndex
MAPIMess.AttachmentType = vbAttachTypeData
MAPIMess.MsgSubject = "Testing email"
txtNoteText = String$(MAPIMess.AttachmentCount, " ") + txtNoteText
MAPIMess.MsgNoteText = txtNoteText
Can you please amend this code for more than one atachment file.
Thanks a million!