Hi!
I need to send an email message to a Lotus Notes Server. The information contained in this email will be sent by an RPG program. The big question is, how do I do that? Can anyone help me, please? Thanx in advance
Melissa
Software/Hardware used:
ASKED:
November 16, 2005 5:03 PM
UPDATED:
November 17, 2005 3:51 AM
first, check if you as400 is configured to send email.
something like this :
SNDDST TYPE(*LMSG) TOINTNET((&TOINTNET *PRI)) +
DSTD(&SUBJECT) LONGMSG(&LONGMSG) +
CFMDEL(*YES) PTY(*HIGH)
if it does not work look in search400 for a configuration, there are some (i have used it a fex years ago)
when it works, then insert your SNDDST in your rpg :
D QCmdExec PR EXTPGM(‘QCMDEXC’)
D cmd 5000A CONST
D cmdlen 15P 5 CONST
d AS400Cde s 5000 varying
c eval as400cde = ‘SNDDST TYPE(*LMSG) ‘
c + ‘CFMDEL(*YES) ‘
c*********************** + ‘IMPORTANCE(*HIGH) ‘
c*********************** + ‘PTY(*HIGH) ‘
c + ‘TOINTNET(‘ + emailTo + ‘) ‘
c + ‘DSTD(‘
c + quote(%subst(emailsubject: 1: 44))
c + ‘) ‘
c + ‘LONGMSG(‘ + quote(emailtexte
c ) + ‘)’
C Callp(e) qcmdexec(AS400cde :
C %len(AS400CDE))
c if %error
c exsr *pssr
c endif
c
Just as an addendum to the above, SNDDST TYPE(*LMSG) lets you send up to 5000 characters, SNDDST TYPE(*MSG) only sends 256 characters. If you need to send more than that or indeed append files, it might be worth looking at MMAIL, a free sofware utility that can send spool files, database files or IFS stream files (ASCII or HTML) as attachments. It even manages basic PDF conversion if you want it. Details are at
http://www-922.ibm.com/mmail.
We use it to send acknowledgments to customers and it works very well. It also includes some useful hints on what you need to configure to get your AS/iSeries sending SMTP mail in the first place.