Like the name implies. I need to modify a variety of programs to email reports to userlists where they are hardcoded to send to certain users, a large amount are clles. Basically, what is the syntax for userlist functionality in cl?
Asked
Active
Viewed 765 times
0
-
3Your question is too broad. – Lexib0y Dec 27 '17 at 14:59
-
I don't know what else I would ask for. I just need some example syntax for a userlist. – Chuckles Dec 27 '17 at 15:02
-
1For instance, what is "cl"? I'm pretty sure you're not talking about the C++ compiler and linker. – Avner Shahar-Kashtan Dec 27 '17 at 15:05
-
Well than you have to search for an example. Maybe this helps: https://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros – Lexib0y Dec 27 '17 at 15:06
-
I'm talking about clle (ILE control language (CL) programs). Similar to CLP. I program primarily in rpgle and rpg free. – Chuckles Dec 27 '17 at 15:09
-
See, that might be a good start, rather than using just the initials of an obscure language, without at any point specifying the technology you're using, and tagging it with a tag for a *different* technology with the same initials. – Avner Shahar-Kashtan Dec 27 '17 at 15:27
-
How are you sending email in your CLP program? Are you using the SNDDST command? Using a 3rd party product? – David G Dec 27 '17 at 16:23
-
I suspect if you could define your problem you'd be close to your answer – Richard Evans Dec 27 '17 at 19:38
-
Thanks for the lecture Avner. It's a .clle file written in RDi as part of an AS400 mod 8 database. Currently, it's hardcoded like so: – Chuckles Dec 27 '17 at 20:36
-
DCL VAR(&EMAIL1) TYPE(*CHAR) LEN(40) + VALUE('EMAIL@.COM') – Chuckles Dec 27 '17 at 20:37
-
IF COND(&RECORDS *GT 0) THEN(DO) IF COND(&EMAIL1 *NE ' ') THEN(DO) CALL PGM(RHPEMAIL) PARM(&EMAIL1 'PGMNAME' + 'PGMNAME' &SUBJECT) ENDDO IF COND(&EMAIL2 *EQ ' ') THEN(DO) CHGVAR VAR(&EMAIL2) VALUE('EMAIL@.COM') ENDDO – Chuckles Dec 27 '17 at 20:38
-
So RHPEMAIL is the program being called to send the mail? I would suggest contacting whoever wrote that program to find out how to use it. – David G Dec 28 '17 at 13:31
-
I just ask an email tech support person to create a "distro" then treat it like an ordinary email address. – danny117 Dec 28 '17 at 18:15
1 Answers
2
The basic command to emaill is this...
SNDSMTPEMM RCP((mydl@mycomp.com)) +
SUBJECT(&SUBJECT) NOTE(&NOTE) +
ATTACH((&ATTACH *EXCEL)) CONTENT(*HTML)
For a professional business email you need to send from a distribution list so replies to the email go to the distribution list not to noreply@somewhere.com
- Create the cl that is doing the emailing with *OWNER authority
- Create a user profile "myuser" to be used for the emailing.
- Create an alias for "myuser" with WRKNAMSMTP
User ID/Address . . . . . : myuser msystem
SMTP user ID . . . . . . : mydl
SMTP domain . . . . . . . : mydomain.COM
then submit the CL for the user myuser. it will appear as if coming from the distribution list and replies will go to the distribution list.
SBMJOB CMD(CALL PGM(myemailc) PARM(&mparm1 &mparm2)) +
JOB(myemailc) JOBD(mylib/myjobd) +
JOBQ(qsysnomax) USER(myuser)

danny117
- 5,581
- 1
- 26
- 35