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



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:
D 'QtmsCreateSendEmail')
D ipRecipients * VALUE
D iuRcvCount 10U 0 VALUE
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), ut looking at the C header files for these two APIs, the first has

#pragma argument(QtmmSendMail, OS, NOWIDEN)

while the second doesn't.

Pete


"Peter Clifford" <pete@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:mailman.2868.1224325223.30674.midrange-l@xxxxxxxxxxxxxxx
If I'm doing something stupid, I hope one of you guys can spot it as this has got me beat at the moment.

I've pared things down to the simplest possible call just to try to get started with it. I've also changed the prototype for the call slightly (to use pointers rather than character fields for the attachment details just in case that made a difference as the spec refers to these needing to be "null" if not used. But I'm still getting the same thing.

I'm not using any of the encryption features, so I don't think there should be a need for any additional setup at this stage (if there is, then the error message I'm getting is misleading to say the least).

Parameters as defined at http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/apis/qtmscreatesendemail.htm

Required Parameter Group:

1 Recipient array Input Char(*)
2 Number of recipients Input Binary(4)
3 Format name of recipient array Input Char(8)
4 Note Input Char(*)
5 Format name of note Input Char(8)

Omissable Parameter Group:

6 Attachment array Input Char(*)
7 Number of attachments Input Binary(4)
8 Format name of attachment array Input Char(8)
9 Error Code I/O Char(*)


Structure as defined at http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/apis/qtmscreatesendemail.htm
RCPT0100 Format
Offset Type Field
Dec Hex
0 0 Binary(4) Input CCSID
4 4 Binary(4) Recipient Type
8 8 Binary(4) Offset to recipient address
12 C Binary(4) Length of recipient address
Char(*) Recipient address


Here's my ILE RPG prototype:

D CrtSndMail PR EXTPROC('QtmsCreateSendEmail')
D iaRecipients 32767A CONST OPTIONS(*VARSIZE)
D iuRcvCount 10U 0 CONST
D iaRcvFormat 8A CONST
D iaNote 32767A CONST OPTIONS(*VARSIZE)
D iaNoteFormat 8A CONST
D ipAttachments...
D * CONST OPTIONS(*NOPASS)
D iuAtcCount 10U 0 CONST OPTIONS(*NOPASS)
D ipAtcFormat * CONST OPTIONS(*NOPASS)
D baAPIError OPTIONS(*NOPASS)
D LIKEDS(APIError)

Here's the recipient structure:

D RCPT0100 DS QUALIFIED
D suRcvCCSID 10U 0
D suRcvType 10U 0
D suRcvOffset 10U 0
D suRcvLength 10U 0
D saRcvEmail 256A

D Recipient DS LIKEDS(RCPT0100)
D BASED(wpRecipient)

D Recipients DS BASED(wpRecipients)
D saRecipients 65535A

Heres the call:

CrtSndMail(Recipients:
wuRcvCount:
'RCPT0100':
Note :
'NOTE0100':
*NULL :
0 :
*NULL :
APIError );

Variable contents before the call:

EVAL wprecipients
WPRECIPIENTS = SPP:00008000050B60A0

EVAL wprecipient
WPRECIPIENT = SPP:00008000050B60A0

EVAL recipients:x
00000 00000025 00000000 00000010 0000001D - ................
00010 A2A49797 9699A37C 81998981 849585A2 - support@ariadnes
00020 9686A3A6 8199854B 83964BA4 92404040 - oftware.co.uk

EVAL recipient
RECIPIENT.SURCVCCSID = 37
RECIPIENT.SURCVTYPE = 0
RECIPIENT.SURCVOFFSET = 16
RECIPIENT.SURCVLENGTH = 29
RECIPIENT.SARCVEMAIL =
....5...10...15...20...25...30...35...40...45...50...55...60
1 'support@xxxxxxxxxxxxxxxxxxxxx '

EVAL wuRcvCount
WURCVCOUNT = 1

EVAL note:x
00000 00000025 00000000 00000000 00000024 - ................
00010 00000016 0000003A 0000001E 00000000 - ................
00020 00000000 D48199A8 40888184 40814093 - ....Mary had a l
00030 89A3A393 85409381 9482C9A3 7DA24086 - ittle lambIt's f
00040 93858583 8540A681 A240A688 89A38540 - leece was white
00050 81A240A2 9596A64B 40404040 40404040 - as snow.

EVAL note
NOTE.SUNOTCCSID = 37
NOTE.SUNOTPWDOFF = 0
NOTE.SUNOTPWDLEN = 0
NOTE.SUNOTSUBOFF = 36
NOTE.SUNOTSUBLEN = 22
NOTE.SUNOTMSGOFF = 58
NOTE.SUNOTMSGLEN = 30
NOTE.SUNOTSECLVL = 0
NOTE.SUNOTCNTTYPE = 0
NOTE.SANOTDATA =
....5...10...15...20...25...30...35...40...45...50...55...60
1 'Mary had a little lambIt's fleece was white as snow. '
61 ' '

EVAL apierror:x
00000 00000110 00000000 40404040 40404040 - ........
00010 40404040 40404040 40404040 40404040 -

After the call:

EVAL apierror:x
00000 00000110 00000014 E3C3D7F5 F3F0F8F0 - ........TCP53080
00010 A2A49797 40404040 40404040 40404040 - supp

The error data here is always the first 4 characters of whatever email address I define in the recipient structure.

Any ideas? I've applied all PTFs I can find thsat mention this API.

Thanks

Pete
"Simon Coulter" <shc@xxxxxxxxxxxxxxxxx> wrote in message news:mailman.2861.1224318657.30674.midrange-l@xxxxxxxxxxxxxxx

On 18/10/2008, at 5:25 AM, Peter Clifford wrote:

Anyone had any success using the new QtmsCreateSendEmail API on V6R1?

I'm pretty familiar with these APIs and have been working with QtmmSendMail
for several years but I'm getting nowhere with even the simplest call to
QtmsCreateSendEmail. I keep getting TCP5308 "CCSID &1 not supported" where
the substitution data for &1 is the first 4 characters of the email address.
I'm beginning to wonder whether the documentation is wrong (or at least if
I've misunderstood it, though I don't see how) and the structure layout is
different to what I've programmed to?


Have you built the recipient structure properly? Show us your definition and the data it contains.

Try with one recipient address and then with two. If one works and two fails your second structure is in the wrong place. The API will use the information in the first structure to calculate the starting position of the following structure.

If one fails then you know your basic structure is wrong.

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

Follow-Ups:
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.