How do you email to a userlist in CL?

886 Views Asked by At

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?

1

There are 1 best solutions below

0
On

The basic command to emaill is this...

SNDSMTPEMM RCP(([email protected])) +            
             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 [email protected]

  1. Create the cl that is doing the emailing with *OWNER authority
  2. Create a user profile "myuser" to be used for the emailing.
  3. 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)