Reputation: 19
Does anybody know how to tell SNDSMTPEMM that a email recipient address variable should not be processed? This can be done with the attachments by specifying "*NONE" but neither "*N" nor "*NONE" or blanks work on the email addresses. I have created a command interface and a CL CPP program that will ask for email addresses and *PRI/*CC/*BCC that will be used with the SNDSMTPEMM command. The command interface will list all entries in a user's output queue and send the contents to one (or more) email addresses. Because there can be up to 20 email addresses, I need to be able to process the SNDSMTPEMM command with any number of emails. If I could specify all 20 email address variables and all 10 file attachments in a single command instance that would be best (assuming that the command has some a way to identify which email address to actually process). Right now, I can get around this by expanding the process to run the SNDSMTPEMM command based on the number of email addresses entered. But this will involve copying the command for each set of email addresses - I am trying to find a better solution.
Upvotes: 0
Views: 209
Reputation: 14519
It sounds like you have written or are writing your own "wrapper" for SNDSMTPEMM, and you want to be able to accept up to 20 recipients and pass them along to SNDSMTPEMM, something like
SNDSMTPEMM RCP((&ADDR1 &TYPE1)
(&ADDR2 &TYPE2)
(&ADDR3 &TYPE3)
...
(&ADDR19 &TYPE19)
(&ADDR20 &TYPE20))
SUBJECT(&SUBJ)
NOTE(&BODY)
And you've defined variables for 20 recipients, and want to always include all the variables in the SNDSMTPEMM command; but of course usually there will be fewer than 20 actual recipients, so you want to know how to tell SNDSMTPEMM to ignore some of the (&ADDRn &TYPEn) variable pairs.
I do not think there is a way to do that. I think you have to pass only the variables that are needed. Probably the best way to achieve what you want is to build the SNDSMTPEMM command dynamically, as a string, and then use QCMDEXC or similar to execute that string as a command.
Upvotes: 0