Go Premium for a chance to win a PS4. Enter to Win


PowerBuilder: MAPI, sending multiple attachment files

Posted on 2000-03-20
Medium Priority
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 400 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

916 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