Create and Send an E-Mail without using COPIAFACTS

EMDIRECT [parmfile] [name=value ...]

This program sends one or more e-mails, transmitted without using the COPIAFACTS engine.  Only simple e-mails with subject, body, and optional attachments are supported, and the primary purpose is to send e-mail notifications of system incidents to an administrator, which use EMDIRECT automatically.  If you have an e-mail to SMS service available, you can also use the e-mails to deliver an SMS message.

If you used EMDIRECT in 8.1, its default SMTP server settings were held independently in the registry.  In 8.2, these settings are no longer used at all, and EMDIRECTinherits its server settings from EMSETUP.  These are the default values for HOST, PORT, USERNAME, PASSWORD, SIGNON, FROM and SENDER.  The defaults can still be overridden from a parameter file or from the command line.

EMDIRECT is used to send the system notification e-mails, and for sending files from an Explorer right-click menu, which you may have configured in EMSETUP.  EMDIRECT must therefore be installed on the machine where the notification originates, and EMSETUP must have been run to set up the server parameters.  When used for notifications, a subject and body are provided and no control file is used.  A default sender must be defined in EMSETUP, and addressee(s) either in EMSETUP or in the trigger settings. The SMTP settings are all defined in EMSETUP and cannot be overridden for these tasks.

Because the e-mail is sent directly by EMDIRECT, it is not necessary to copy any file to be transmitted to your fileserver.  This means that you can send e-mail notifications even if your file server is not accessible (but provided of course, that the machine still has Internet access).

To allow for use in a failure notification scenario, this program does not attempt to access the standard CopiaFacts command files such as FAXFACTS.CFG: configuration variables and standard folder names are not expanded from the template file.  And unlike normal CopiaFacts e-mail operations, EMDIRECT requires the name of your e-mail server and your login credentials, just as you would enter them in your usual e-mail client.  EMDIRECT does not connect directly to each recipient's mailserver: it only sends mail using an SMTP server to which you have login credentials or which your machine is configured to use automatically.

Automatic Triggered Notifications

The triggers invoke EMDIRECT and supply a subject and body text on the command line, along with the From address and To address(es) specified in EMSETUP.  The To addresses can also be overridden in EMSETUP for individual triggers.  All the SMTP parameters are defaulted from the settings in EMSETUP.

When triggered by OMACHECK, EMDIRECT will add the last 20 entries in the Windows Event Log for CopiaFacts into the e-mail body text.

Command-line

Command-line parameters, or a control file, supply the details of the e-mail to be sent.  When a control file is specified, all individual name=value parameters override its contents, even if they precede it on the command line.  The basic details of the SMTP server to be used are derived from those set in EMSETUP, but can be overridden.

A command-line parameter not containing an = sign is taken to be the name of a parameter file consisting of only name=value lines.  This allows pre-defined messages and attachment sets to be selected by specifying only the parameter file.

Command-line parameters containing an = sign override the parameters in the parameter file, if the name matches one of those listed below.  Other variables defined on the command line are used to expand `varname values in the registry, the parameter file and in the body text and subject.  Note that because FAXFACTS.CFG is not read, the variable expansion character cannot be changed from 'accent grave'.  Also a value to be used in a substitution in this way must not itself contain a further `vaname to be expanded.  There is no provision for comments in the parameter file.

All pathnames must be specified in full.  The normal variables like FFBASE and FFUSER are not supported because FAXFACTS.CFG may not be available.

EMDIRECT now uses FFTRACE when a detailed log is required.  The TRACE option in earlier versions is no longer used.

Parameters

Parameter Name

Usage

Notes

HOST

Name or IP address of mail server

As configured for ISP in EMSETUP; can be overridden.

PORT

Protocol name (e.g SMTP) or port number

As configured for ISP in EMSETUP; can be overridden.

USERNAME

Login name for your mail server

As configured for ISP in EMSETUP; can be overridden.

PASSWORD

Password for your mail server

As configured for ISP in EMSETUP; can be overridden.

SIGNON

Parameter sent with HELO or EHLO (external IP address)

As configured for ISP in EMSETUP; can be overridden..

BINDIP

Local IP adapter address

Defaults to use any adapter

X-MAILER

X-Mailer: header

Defaults to "CopiaFacts EMDirect"

TO

To: addresses, separated by commas if more than one

At least one address is required

CC

Cc: addresses, separated by commas if more than one


BCC

Bcc: addresses, separated by commas if more than one


FROM

From: address

As configured for ISP in EMSETUP; can be overridden.

SENDER

Sender: address

Defaults to use From address; can be overridden

SUBJECT

Subject: header

Optional, recommended

BODY

Pathname of plain text body file, or TEXT:textline

Optional

HTML

Pathname of HTML body file, or TEXT:textline

Optional

ATTn

(n = 1..8) Attachment file pathname

First gap in range 1..8 terminates the list of attachments

WRAP

0 or 1 to disable or enable wrap in message text

Default is 1

LOG

Pathname of log file to which log will be appended

Default is C:\FAXTEMP\EMDIRECT.LOG; set to empty to disable

Sample Parameter File, Body File, and Command Line

The following parameter file will send a notification to a pre-determined person, overriding the settings made in EMSETUP:

HOST=smtp.myISP.net

USERNAME=tim@copia.com

PASSWORD=xyzzy

SIGNON=217.146.122.81

TO=tim@copia.com

FROM=tim@copia.com

SUBJECT=Notification from CopiaFacts

BODY=TEXT:Problem on node `node

CC=support@copia.com

ATT1=c:\faxtemp\error.log

LOG=c:\faxtemp\special.log

You could initiate the sending of the e-mail by running a batch file containing:

EMDIRECT c:\tmp\emdirect.ini "node=%1"

You could also override the addressee by using:

EMDIRECT c:\tmp\emdirect.ini "node=%2" to=steve@copia.com

Note that this will replace the TO specification in the parameter file, not add to it.