Question

I am trying to send an email with multiple attachments using the VB6 MAPIMessages control.

1) I am able to use this control to send a single attachment but it displays an error saying "Attachment not found", if I try to send more than one file.

2) I also need to suppress the warning message when I try to send an email

Any ideas?

Here's the code:

MAPISession1.SignOn

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose

MAPIMessages1.RecipDisplayName = "abbid_siddiqui@hotmail.com"
MAPIMessages1.MsgSubject = "MAPI subject with attachments"
MAPIMessages1.MsgNoteText = "This is  atest"

MAPIMessages1.AttachmentIndex = 0
MAPIMessages1.AttachmentName = "test.csv"
MAPIMessages1.AttachmentPathName = "C:\test.csv"

MAPIMessages1.AttachmentIndex = 1
MAPIMessages1.AttachmentName = "holidays_2013.xls"
MAPIMessages1.AttachmentPathName = "E:\holidays_2013.xls"

MAPIMessages1.ResolveName

'Send the e-mail message to the Recipient
MAPIMessages1.Send
Was it helpful?

Solution

Try setting the AttachmentPosition property to the same value as the AttachmentIndex

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top