PSMAIL Command in SQR with PeopleSoft Application

PSMAIL.EXE looks for the environment variable PS_SERVER_CFG to retrieve its SMTP Settings.  That variable is usually set on the Application Server and Process Scheduler on boot up.  On the Application Server, it usually is set to 
%PS_HOME%\appserv\<domain name>\psappsrv.cfg.  On Process Scheduler, it usually points to %PS_HOME%\appserv\prcs\<database name>\psprcs.cfg.

The possible command line arguments are:

TO = the recipients of the email
CC = carbon copy list of recipients
BCC = blind carbon copy list of recipients
FROM = the sender of the email
SUBJECT = the subject heading of the email
BODY = the email body
FILE = list of file attachments to send with email.  File location is relative to where PSMAIL.EXE is run from.
INPUT=points to a config file that contains the above seven arguments.  This was to bypass the maximum number of characters allowable on a command line and carriage return/line feeds.

The tokens - or / can be used in front of the above arguments.  The values for each argument must be encapsulated in double quotes.  Look at the following examples.

PSMAIL -TO"" -FROM"" -SUBJECT"Test Subject 

PSMAIL /TO" email1" /FROM"" /SUBJECT"Test Subject" /BODY"This is test email"

PSMAIL /INPUT"myfile.txt"
If you are using -INPUT or /INPUT then you need to have the input file in UNICODE format.

(on NT, you can do this by saving the file in notepad as "unicode format" & 
on Unix you can run the following PeopleSoft binary file
PSUNICONV ASCII <inputfile> UCS-2 <outputfile>)