PowerBuilder: MAPI, sending multiple attachment files

Everything with sending e-mail using the Pb MAPI mailobjects works fine, even with (one) attachment.

EXCEPT, when sending more-than one attachment file, then sendmail returns FAILURE.

I just fill the mailmessage.attachmentfile[] array, like in the pb-examples.

Help me!
sulfurAsked:
Who is Participating?
 
david_levineCommented:
Here's a couple of suggestions I found. Let me know if any help.

-----------------

You need to set the Position property  of the attachment - contrary to what the online help says, this is not read-only.  Set it to 0 for the first attachment, 1 for the second, and so on.

-----------------

Use the mailFileDescription object.
like this;
 
MailFileDescription  mAttach
MailMessage          mMsg
STRING                ls_destination, ls_filename
INT                        li_count
 
....some preprocess for mMsg
 
do
.....
.....
// describe the attachment
mAttach.FileType = mailAttach!
mAttach.PathName = ls_destination
mAttach.FileName = ls_filename
 
// position in text
mAttach.Position = len(mMsg.notetext) - 1
 
// count to next position
li_count ++
 
// set the attachment
mMsg.AttachmentFile[li_count] = mAttach
.....
.....
loop

------------------

0
 
sulfurAuthor Commented:
Thanks David it works!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.