Operating System - OpenVMS
1827633 Members
3731 Online
109966 Solutions
New Discussion

Using VMS MAIL CC Field in mail batch generated messages

 
Andrew Rycroft
Advisor

Using VMS MAIL CC Field in mail batch generated messages

Hi,

We have a large number of mail notifications from our various monitoring processes. We now want to CC various managers on some of the e-mails. VMSmail does have a CC: option for interactive use. How can we use it in a command procedure ?

With regards
Andrew
4 REPLIES 4
Volker Halle
Honored Contributor

Re: Using VMS MAIL CC Field in mail batch generated messages

Andrew,

looks like there is no access to the /CC qualifier directly from DCL.

As a workaround, you can use a construct like this in a command procedure:

$ MAIL
SEND/CC/NOEDIT filename-to-send.tmp
to-username
cc-username
subject string
$

This invokes the MAIL utility and causes it to read commands from SYS$INPUT, which is your command procedure. You just need to make sure to provide the correct input line by line, which the MAIL utility will be asking for.

If you need to specify varying filenames or username lists, you could write the above commands into a temporary tmp.COM file and then execute it with @tmp.com

Volker.
Kris Clippeleyr
Honored Contributor

Re: Using VMS MAIL CC Field in mail batch generated messages

Andrew,

As an alternative to Volker's suggestion, make use of a distribution list file.

$ MAIL file-spec "@USERS"

where the file USERS.DIS contains the user names of the people you want to send mail to.

You can also combine a distribution list with explicit user names.

$ MAIL file-spec user,"@USERS"

The adressees however will appear in the "To:" field of the mail message, and not in the "CC:" field.

Greetz,

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Hein van den Heuvel
Honored Contributor

Re: Using VMS MAIL CC Field in mail batch generated messages

CC functionality was oddly enough only added to VMSmail in VMS V5.
The lack of a DCL qualifier is pretty much an oversight.
Soft, internal, nudges to the developpers at the time (1998, 2002) were ignored, and customers never requested it officially, so there we are :-(.

You may want to check out the DELIVER tool for some incremental functionality from VMSnail (like forward to a group).

If those monitoring jobs are strictly batch jobs, then creating an intermediate file is the way to go.
If there are images/code involved which today perhpas spawn mail, then I['d encourage you to check out calleable mail to get access to CC and to becme more efficient in the process. It is not _that_ hard, if you've programmed itemlists before.


There is a silly work-around / fooled-you solution:

$ define cc " "
$ mail/subj="whatever" filename user1,cc,user2

It will *look* okay; the received message will have

To: USER1,CC,USER2

but will not have a CC line.


Cheers,
Hein.
Mobeen_1
Esteemed Contributor

Re: Using VMS MAIL CC Field in mail batch generated messages

Andrew,
We do use the CC field, hence our scripts look like the one suggested by Hein i.e
Invoke mail utility and use

rgds
Mobeen