Send a Mime Mail
|
|
Cette page a été mise
à jour le 14 septembre 2009.
Contact |
|
Versionning
last version : How to upload to my 400
CHGPFM FILE(JPLTOOLS) MBR(MAIL) SRCTYPE(CMD) EXPDATE(*NONE) SHARE(*NO) TEXT('send a mime mail')
CHGPFM FILE(JPLTOOLS) MBR(MAILR) SRCTYPE(SQLRPGLE) EXPDATE(*NONE) SHARE(*NO) TEXT('send a mail')
CRTCMD CMD(MAIL) PGM(MAILR) SRCFILE(JPLTOOLS) SRCMBR(MAIL)
CRTSQLRPGI OBJ(MAILR) SRCFILE(JPLTOOLS) COMMIT(*NONE) OBJTYPE(*MODULE) OPTION(*NOSEQSRC *XREF *SECLVL) CLOSQLCSR(*ENDMOD) REPLACE(*YES) SQLPATH(*LIBL) DBGVIEW(*SOURCE) USRPRF(*USER)
CRTPGM PGM(MAILR) ACTGRP(jpltools) bnddir(qc2le) BNDSRVPGM(QTCP/QTMMSNDM)
This tool based on the api TMMSENDMAIL (a procedure from QTCP/QTMMSNDM) implements main rfc822 & rfc1521 recommendations. It can send many documents attached and a body in text or html format to many receivers. It's not JavaMail, it's pure native code. If it's your target, you can find an implementation of javaMail at Java From Rpg
MAIL SUBJECT('a new mail tool')
SENDER(*me)
RECEIVER((*TO 'you@company.com')
(*CC 'you@company.com')
(*BCC 'you@company.com'))
MESSAGE('<html><body><h3>Hello,<br>How are you ?</h3></body></html>')
MSGTYPE('text/html')
ATTACH((*BIN *ATTACHED 'image/jpeg' '/jpl/jpl.bmp'))
|
mail builds a temporary IFS file that is sent to recipient by the API. I have located this file with the data area MAIL
You need to run one time these two commands:
CRTDIR DIR('/Mail') RSTDRNMUNL(*NO)
|
qtmmsendmail is an interface to QMSF (the Mail Service Framework of the 400). If SNDDST already works on your 400, then you don't need more configuration. If no, have a look at http://jplamontre.free.fr/AS400/SolvingEmailProblem.htm or http://iseries.pentontech.com/t?ctl=35231:11FF94
The
source code is
provided as an open source tool under the GNU
General Public License,
version 2.
In summary, this
license specifies:
By clicking the download link you acknowledge and agree to the terms of the license.
Download the (zipped) SAVF containing the JPLTOOLS : the source file, the message file, the bnddir