Mail.exe

Purpose

Asynchronous/deferred sending of e-mail messages.

Details

This auxiliary program can be used to perform asynchronous or deferred sending of e-mail messages, including the special ones generated by ThinkDesign through the HelpSend a Note form or the HelpRegistration wizard.

Here are the advantages of using Mail.exe:

Usage

Mail.exe [options]

Where allowed options are:
-sn <dir> Send-a-Note mode: the <dir> directory (required) contains one or more messages generated by ThinkDesign's Send-a-Note tool. Multiple directories (messages) can be processed in a single run by using wildcards, as explained below.
-to "x" Defines the recipient(s) of the message
-subject "x" Defines the subject of the message
-text "x" Defines the text of the message as a char string
-text "@x" Defines the text of the message as the contents of "x" file. Multiple text files may be processed using wildcards: in this case a separate e-mail is sent for each text file found, using the same recipient and subject.
-attach "x" Defines files to be sent with the message as attachments. Multiple file names can be included in the "x" list, separated by colons (;).
-del Data has to be removed from disk after successful sending of the message(s)
-edit Before sending the mails it shows their contents so to do the editings, if any.
-log "x" The error messages, if any, are written on the "x" file. If this option is missing the error messages are displayed on a MessageBox.
-profile "x" Use profile "x" to access MAPI services (default: use standard profile)
-user "x" Username to be used for logon
-passwd "x" Password to be used for logon
-single Together with the "wait" option it allows to schedule the program and to make it wait for a pre-defined time. This way it is not necessary to activate an external agent to schedule the program.
-wait "x" Together with the "single" option it allows to show the wait-range in term of seconds of the program. Used by itself, it warrants that there is only one scheduled copy of the program: each time the program starts, it checks that there isn't a copy of itself being executed, on the contrary it waits "x" seconds for the operation being carried out to end; if this doesn't happen, it ends up displaying an error.

Sending regular e-mail

Mail.exe can be used to send regular e-mail by supplying all needed data in the command-line arguments, as in the following examples:
 

Sending messages generated by Send a Note

Send a Note, or similar tools, write the data related to a message in a disk directory: Mail.exe may then be used, with –sn option, to read the directory and send the message.

Examples:

Mail.exe -sn C:\SendMailDir\dirmsg1 -del
Read message data contained in directory "C:\SendMailDir\dirmsg1", send the message and, if successful, delete "dirmsg1" and all the files it contains.
Note that no recipient, subject or text are supplied in the command-line: these information have been written from Send a Note into files in the message directory.

Mail.exe -sn C:\SendMailDir\mail_* -del
Send messages contained in all subdirectories of "C:\SendMailDir" whose name matches the wildcard expression: "mail_*" (e.g.: mail_001, mail_user1_1, ..). Each subdirectory is deleted after its message has been successfully sent.