Sending Emails with multiple attachments

MattNorman

Member
The business function B0500725 allows for one attached file per email, however, we need to send multiple attachments on one email.

It appears that the JDE_SendEMailSMTP and JDE_SendEmailSMTPExt APIs allow for multiple attachments to be emailed. There is an example of this in the API guide.

I have written a custom business function, based on B0500725, to send multiple attachments. This business function has a data structure which is based on D05000725 - but which allows for more file names to be input into the business function. (see attached)

My problem is that I get a memory violation when I simply add attachments, becuase I have declared my attachment array with a memory size of 1 attachment.

How do declare the array with a larger memory size?

This is the declaration with a size of 1 attachment:

smtpAtt=malloc(sizeof(JDEMailMessageAtt));

the API guide suggests declaring the array as follows:

JDEMailMessageAtt smtpAtt[5];

(for a memory size of 5 attachments)

However this will not compile.... (am i missing something from my include?)

This is the call to the SendEmail API:

err=JDE_SendEMailSMTP(szFrom,szMessageTextString,szSubject, smtpAtt,NumAttachments, szTo, szCC,NULL);


We are on 8.10 8.94J1. Am running this in development locally on windows - with intermittent success, although it will be eventually run on Sun solaris
 

Attachments

  • 110080-Code.zip
    7.7 KB · Views: 382
I have managed to fix this issue. As thought it was due to the declaration of the attachments array as one attachment in size....

Still cannot get this to work with JDE_SendEMailSMTPExt.
 
hi

Good Day,

Request to send the updated code for this businessfunction.

I would like to use in my current process.

Thanks
Srikanth
 
Hi Matt,

Can you please share BSFN revised logic with data structure, as I would like to utilize the same for one of my similar requirement.

If possible can you mail it to me [email protected]

Appreciate you help


Thanks,
Ganesh
 
Back
Top