× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The advantage of this API is that it supports encryption (S/MIME), but it does lack the flexibility of QtmmSendMail, which allows you define all of the MIME content yourself pretty much.

"Vern Hamberg" <vhamberg@xxxxxxxxxxx> wrote in message news:mailman.2924.1224365931.30674.midrange-l@xxxxxxxxxxxxxxx
YIKES!!!

Simon, this API is a strange mix of things. From the documentation

"This API requires that the user of the job be in the System Distribution Directory (SDD) and have an SMTP name and SMTP domain assigned in the alias table."

It does also require PASE.

At least the older API, QtmmSendMail, does not need one to be in the SDD!!! So what is the point of this one, I wonder?

Vern

Simon Coulter wrote:
On 19/10/2008, at 3:32 AM, Peter Clifford wrote:


This should probably now be on the RPG forum, but just in case anyone is
interested, I managed to get the call to the API from RPG working by
changing my prototype to:

D CrtSndMail PR EXTPROC(*CWIDEN:


You are using 4-byte integers so they are already widened. *CWIDEN should not be needed.


D 'QtmsCreateSendEmail')
D ipRecipients * VALUE


A pointer by VALUE is EXACTLY the same as a variable by REFERENCE so your previous definition should be OK.


D iuRcvCount 10U 0 VALUE


This should be 10I 0. However, if the integers are being passed by VALUE then the API documentation should state that. For C and Unix APIs (so-called industry-standard APIs--don't make me laugh) it is expected that the caller "knows" parameters are passed by value because, of course, that's the only way to do it and certainly the "natural" way for a C weenie to approach things.

Normal OS/400 APIs accept all parameters by reference. Since this API appears to be documented as a normal API it should either be changed to accept parameters by reference or the documentation should be corrected to state passing by VALUE is required.



D ipRcvFormat * VALUE
D iaNote * VALUE
D iaNoteFormat * VALUE
D ipAttachments...
D * VALUE OPTIONS(*NOPASS)
D iuAtcCount 10U 0 VALUE OPTIONS(*NOPASS)
D ipAtcFormat * VALUE OPTIONS(*NOPASS)
D baAPIError OPTIONS(*NOPASS)
D LIKEDS(APIError)

I think the main issue was that I needed to pass the parameters by VALUE.
I'd copid the prototype I use for QtmmSendMail as the starting point for the
prototype for QtmsCreateSendEmail),


When coding prototypes for procedures I find you always have to check the C include definitions just to be sure.

However VALUE doesn't really explain the problem you were experiencing. The error message indicated a problem with the Recipients structure (because the substitution text contained the first 4 bytes of the e-mail address). There is no difference between passing that structure by reference and passing a pointer to that structure by value.

I can understand that VALUE missing from the recipient count field would give an incorrect value therefore the API may have been attempting to process more values than you provided. Perhaps it was simply bad luck that caused the error to appear to be related to the contents of the recipient structure? Random acts of storage?


but looking at the C header files for
these two APIs, the first has

#pragma argument(QtmmSendMail, OS, NOWIDEN)

while the second doesn't.


Shouldn't matter because you are passing wide values anyway.

Is this yet another example of the rot apparent in OS/400? APIs written with the presumption that they will only be called from C. APIs that require PASE to function. Utilities that require PASE to function. Program products that require PASE to function or QSHELL to install and manage. HMC that is Unix. Soon it seems XPF will be nothing more than a thin veneer over a Unix system. Excuse me while I puke.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.