The command line interface to AutoMSW lets you use the power of AutoMSW from a command prompt, batch files, macros, and other situations when you prefer to not use the regular graphical user interface.
Trial Period:
The command line interface is available to try out in any version of AutoMSW, but to use the command line interface past the trial period a Professional level license is required. The trial period of the command line interface is 20 successfully completed jobs.
Running AutoMSW from a Command Line:
To use the command line interface call the AutoMSW program with the /file option and the filename of an "arguments file". An arguments file is a text file that contains instructions on how to run this job. An example command line would be:
"C:\Program Files\AutoMSW\automail.exe" /file "C:\Program Files\AutoMSW\cloptions.txt"
This example specifies the full path and filename of both the AutoMSW executable and the arguments file. If your path or filename contains spaces put the whole path and filename in double quotes. The double quotes are not required if you don't have spaces in the path or filename. You could also run it like:
automail.exe /file cloptions.txt
if the command is being run from the same folder as the executable and the arguments file. (You may also make use of the PATH environment variable. Consult your Windows documentation). For an example batch file showing how to run AutoMSW and process any error values returned see the "Sample.bat" file in your AutoMSW folder.
Arguments File:
The arguments file passed in on the command line is a plain text file. A sample arguments file called "cloptions.txt" is included in your AutoMSW folder. The following commands are available for use in your arguments file:
|
Send Method |
Set to a number 1, 2, or 3:
1 = Direct Send |
|
Direct From |
The 'From' e-mail address when using the Direct Send method |
|
SMTP From |
The 'From' e-mail address when sending through an SMTP mail server |
|
SMTP Server |
The SMTP mail server name to use when sending through an SMTP mail server |
|
SMTP Authentication |
Set to 1 to use authentication, or 0 when authentication is not needed. Use when sending through an SMTP mail server. |
|
SMTP Username |
The username to authenticate with when sending through an SMTP mail server |
|
SMTP Password |
The password to authenticate with when sending through an SMTP mail server |
|
SMTP Port |
Specify the port number when connecting to the SMTP server. Use -1 for the default port, or specify any other desired port number. |
|
SMTP SSL |
Set to 1 to use an SSL connection to the SMTP mail server. Set to 0 when an SSL connection is not required. |
|
Subject |
The subject to use for your messages. The subject can optionally contain mail merge fields. |
|
Mail List |
Specify the full path and filename of the mailing list file. |
|
Text Message |
Specify the full path and filename of the plain text version of the message. |
|
HTML Message |
Specify the full path and filename of the HTML version of the message. |
|
Use HTML |
Set to either 1 (use HTML) or 0 (plain text) |
|
AddAttachment |
Specify the full path and filename of a global attachment. This command can be used multiple times to specify multiple global attachments. |
All commands are optional in the arguments file. If a command is not present the default value will be used. The default values are the values that were last set through the graphical user interface. An example arguments file is shown here:
#
# From
# How your emails are sent, and from where#
Send Method: 1Direct From: "ACME Sales" <sales@mydomain.com>
#
# Subject
# The subject of your messages
#
Subject: New Product Announcement for [[Name]]
#
# Mail List
# Specify the full path and filename of the mailing list file
#
Mail List: C:\Program Files\AutoMSW\Lists\testlist.txt
#
# Text Message and HTML Message
# Specify the full path and filename of the message file(s)
#
Text Message: C:\Data\ProductABC\Notification Letters\Announce.txt
HTML Message: C:\Data\ProductABC\Notification Letters\Announce.html
#
# Use HTML
#
Use HTML: 1
#
# AddAttachment
# This command can be used multiple times to add additional global attachments# You can also use wildcards (* and ?) in the filename
#
AddAttachment: C:\Data\ProductABC\Notification Letters\specs.pdf
AddAttachment: C:\Data\ProductABC\Notification Letters\specs.docAddAttachment: C:\Data\ProductABC\Invoices\*.txt
Return Values:
AutoMSW returns one of the following values upon completion:
|
0 |
Job Completed Successfully |
|
1 |
Job Failed: Unknown Error |
|
2 |
Job Failed: Syntax Error On Command Line |
|
3 |
Job Failed: Couldn't Open Arguments File |
|
4 |
Job Failed: Missing Backslash Error |
|
5 |
Job Failed: Trial Period Expired |
|
6 |
Job Failed: Invalid License, Contact us... |
|
7 |
Job Failed: Memory Allocation Error |
|
8 |
Job Failed: Failed To Open Current Job Log |
|
9 |
Job Failed: Failed To Open Historical Job Log |
|
10 |
Job Failed: Failed To Open Mailing List |
|
11 |
Job Failed: Failed To Find Email Column In Mailing List |
|
12 |
Job Failed: Failed To Open Failed List Log |
|
13 |
Job Failed: Failed To Open Failed List With Reason Log |
|
14 |
Job Failed: Failed To Open Sent List Log |
|
15 |
Job Failed: Bad Syntax On AddAttachment Statement |