Debbie,
The point of this method is that it allows you to run a Net.data
function without the need for any HTTP server.
We do indeed send email like this using a few lines of CLP.
The iSeries SMTP server does not need to be running nor does the STRMSF
feature since the email request is routed to the Exchange mail server
specified in the INI file.
Peter
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DebbieKelemen
Sent: Saturday, 5 August 2006 10:38 a.m.
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Sending Email From RPG
For this to work then, do you have to have your HTTP server up and
running
all of the time? And are you sending mail through it? Is it routing
through HTTP and then on to the Exchange server, instead of SMTP?
Debbie Kelemen
Sr. Programmer/Analyst
(719) 272-2617
email: <mailto:dkelemen@xxxxxxxxxxxxxxxx> dkelemen@xxxxxxxxxxxxxxxx
web: <http://www.chefscatalog.com/> www.chefscatalog.com
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Peter Connell
Sent: Friday, August 04, 2006 2:35 AM
To: RPG programming on the AS400 / iSeries
Subject:
Mike,
No download, no install required.
Just enter the commands below on a command line.
All you need to know is the domain name or IP address of your email
server. For example, we use an Exchange server at
nzaklbh-ex0001.corp.bayadv
1. Create an INI file
CRTSRCPF FILE(QGPL/INI) RCDLEN(240) MBR(DB2WWW)
2. Load your SMTP server name using EDTF
EDTF FILE(QGPL/INI) MBR(DB2WWW)
and add the following line
DTW_SMTP_SERVER nzaklbh-ex0001.corp.bayadv
3. Create a script to call the email function
EDTF FILE(Qgpl/INI) MBR(EMAILTEST)
and add the following line to create a simple script
%html(macro) { @dtw_sendmail("koldark@xxxxxxxxx",emailTo,emailMsg) %}
4. Load the path to your email script
ADDENVVAR ENVVAR(PATH_INFO) REPLACE(*YES)
VALUE('/qsys.lib/qgpl.lib/ini.file/emailtest.mbr/macro')
5. Set the value of parameters for emailTo and emailMsg
ADDENVVAR ENVVAR(QUERY_STRING) REPLACE(*YES)
VALUE('emailTo=peter.connell@xxxxxxxxxxxxxxxxxxxx&emailMsg=Good
morning')
6. Change to the directory where you put the INI file
cd '/qsys.lib/qgpl.lib'
7. Run Net.data
CALL QHTTPSVR/DB2WWW
That's it, the email should be sent.
Steps 1-3 need only be one-time for configuration.
Steps 4-7 can be compiled into a program.
This is a fully supported IBM feature that comes with any iSeries.
The documentation for DTW_SENDMAIL is at
http://www-03.ibm.com/servers/eserver/iseries/software/netdata/db2rn.pdf
There are up to 11 parameters.
For instance if you want to send an rtf attachment
@dtw_sendmail("dtwdude","peter.connell@xxxxxxxxxxxxxxxxxxxx","blah
msg","blah subject"," "," ","","","/www/printversion.rtf")
Peter
----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike
Sent: Friday, 4 August 2006 9:04 a.m.
To: RPG programming on the AS400 / iSeries
Subject: Sending Email From RPG
At my previous job we had MAILTOOL from bvstools.com which I used to
send
email from within RPG programs. While the RPG interface I had was far
from
perfect, it did work. Before I go to my new employer with suggesting
purchasing that same product I want to see what other options there are.