PowerBuilder: MAPI, sending multiple attachment files

Posted on 2000-03-20
Last Modified: 2008-02-26
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!
Question by:sulfur

Accepted Solution

david_levine earned 100 total points
ID: 2636437
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
// 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



Author Comment

ID: 2639450
Thanks David it works!!!!

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question