|
Thanks Vernon,
I'm using a source from Scott Klement I show you: sendmail_h
/if defined(SENDMAIL_H)
/eof
/endif
/define SENDMAIL_H
D QtmmSendMail PR ExtProc('QtmmSendMail')
D FileName 255A const options(*varsize)
D FileNameLen 10I 0 const
D MsgFrom 256A const options(*varsize)
D MsgFromLen 10I 0 const
D RecipBuf likeds(ADDTO0100)
D dim(32767)
D options(*varsize)
D NumRecips 10I 0 const
D ErrorCode 8000A options(*varsize)
D ADDTO0100 ds qualified
D based(Template)
D NextOffset 10I 0
D AddrLen 10I 0
D AddrFormat 8A
D DistType 10I 0
D Reserved 10I 0
D SmtpAddr 256A
// Email Address Type Constants
D ADDR_NORMAL C CONST(0)
D ADDR_CC C CONST(1)
D ADDR_BCC C CONST(2)
Saludos Cordiales,
-----Mensaje original-----
De: Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
Enviado el: viernes, 22 de mayo de 2020 11:45 a.m.
Para: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Asunto: Re: Send more than one recipient with QtmmSendMail is not working
Hello
You did not show us your prototype for QtmmSendMail - number of elements has to be declared BYVAL - that's the first idea I have.
Regards
Vern
On 5/22/2020 10:01 AM, mario.salgado@xxxxxxxxx wrote:
Hello everyone,
I’m trying to send more than one recipient using QtmmSendMail but it’s
only works using 1, I don´t know what is missing or wrong, hope
somebody give me the right direction.
Sending to you the routine I’m using to add 4 mails without luck.
This is the definition for a list of recipient changed for 30 maximum
instead of one.
D recip ds likeds(ADDTO0100)
D dim(30)
Calculus
-----------
For element = 1 to count; // Count is 4 just an example
Select;
When element = 1;
toaddr = 'mario.salgado@xxxxxxxxx';
When element = 2;
toaddr = 'salgadoas400@xxxxxxxxx';
When element = 3;
toaddr = 'mario_salgado@xxxxxxxxx';
When element = 4;
toaddr = 'hn000246@xxxxxxxxxxx';
EndSl;
recip(element).NextOffset = %size(ADDTO0100);
recip(element).AddrFormat = 'ADDTO0100';
recip(element).DistType = ADDR_NORMAL;
recip(element).Reserved = 0;
recip(element).SmtpAddr = toAddr;
recip(element).AddrLen = %len(toAddr);
Endfor;
QtmmSendMail( FileName
: %len(FileName)
: fromAddr
: %len(fromAddr)
: recip
: %elem(recip)
: NullError );
Saludos Cordiales,
As an Amazon Associate we earn from qualifying purchases.
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.