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
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