QuickMail 2.0
© Copyright 2003-2006 Astase
www.astase.com


First, thanks to read and accept the use license of the software by clicking here to use QuickMail.

Presentation

QuickMail is a software which allows to send emails in command line.
You will be able to send emails via software or batch files.

By default, QuickMail proceeds as follow :
    - Analysis of the command line and sending preparation of the email
    - Send the email(s)
    - Succeed ? If yes, QuickMail exits.
    - If not, QuickMail starts again a given number of times before stops (by default 3 times).

For more efficiency, store QuickMail in a directory declared in the PATH (for example in the Windows directory), you would be able to call the software without giving the path each time.

The software prints all messages in English. If you see any fault, do not hesitate to contact us to correct them !

Parameters are formatted as follow :
-Parameter:"Value"

Parameter's value must be between quotation marks. Parameters are separated by spaces :
-h:"smtp.logic.com" -t:"Me@MyCompany.com" -f:"Originator@OtherCompany.org " -s:"Hello !" -b:"Test..."

The list of the parameters accepted by the software is written below. Each parameter is associated to a "short parameter" (one or two characters), useful to reduce the command line length, but meaning the same as long parameters. For example, the two following lines are identical :

-AttachedFile:"C:\Test.exe"
-af:"C:\test.exe"


QuickMail does not take into account lower and upper case in the parameters of the command line.

With "personal" version of Windows, command line length is limited. If the command line is too long, store it in the first line of a text file, and use only the following parameter :
-z:"<path_to_the_file_containing_command_line> "
The first line of the file used in parameter will be treated as the software command line.

If an error occurs, in one hand, QuickMail do not print any message in order to not block a sending process which could be automatic. In the other hand, the software stops and gets back an error code which can be used by your own software (see error codes list below).

Finally, you can not use the character ' " ' (inverted commas) for another use that parameter's delimitation in the command line. If you want to insert any without disrupt the command line, use the character sequence \*\\, which will be replaced during execution by '"'.
In the same way, it is possible to insert carriage return by using the following sequence :
\n\\
Those equivalences are not replaced in the file which is used by QuickMail for body part (if the parameter "BodyFile" is specified), since they are not in the command line, they are authorized.



QuickMail Parameters

Mandatory parameters

-Host : SMTP Server used to send the email
Example : -Host:"smtp.free.fr"
Equivalent short name : -h

-From : Sender email address
Example : -From:"me@aol.com"
Equivalent short name : -f

-To : Recipient email address. If there is more than one, they have to be separated by coma character (',').
Example : -To:"jdl@aol.com"
Equivalent short name : -t

Optional parameters

Concerning the message itself

-Subject : Email subject.
Example : -Subject:"Your new cat"
Equivalent short name : -s

-Body : Email body. The characters sequence "\n\\" will be replaced by carriage returns during execution.
Example : -Body:"Hello,\n\\\n\\Your request has been received and will be treated as soon as possible.\n\\\n\\Jean DUPOND."
Equivalent short name : -b

-BodyFile : Only if BODY is not specified. Import the email body from a text file.
Example : -BodyFile:"c:\letters\letter.txt"
If the file is not found, the email sent continue, except if the parameter "-fqf" is found in the command line.
Equivalent short name : -bf

-CC : Email Addresses separated by coma character (','), where message will be sent in "Carbon Copy".
Example : -CC:"yan@caramail.com,xmickael@aol.com"
Equivalent short name : -cc

-BCC : Email Addresses separated by coma character (','), where message will be sent in "Blind Carbon Copy".
Example : -BCC:"yan@caramail.com,xmickael@aol.com"
Equivalent short name : b-cc

-ReplyTo: If this parameter is specified, it specified the return email address as a different address from the sender email address.
Example : -ReplyTo:"noreply@moi.com"
Equivalent short name : -r

-MailAgent: Identify the software which sent the email.
Example : -MailAgent:"Microsoft Outlook Express 6.0"
Equivalent short name : -ma

-Port: Specify the SMTP server port used (by default, 25)
Example : -pt:2025
Equivalent short name : -pt

-Charset: Identify the char set of the message.
Example : -Charset
:"iso-8859-1"
Equivalent short name : -cs

-ContentType: Identify the content type of the email.
Example : -ContentType:"text/plain"
Equivalent short name : -ct

-ContentDisposition: Identify the special parameter "Content-Disposition" of the email.
Equivalent short name : -cd

-ContentTransfertEncoding: Identify the special parameter "Content Transfert Encoding" of the email.
Equivalent short name : -ce

-HeloName: Identify the parameter which will be sent when the SMTP server ask the user introduction (HELO)
Example : -HeloName:"82.63.110.4"
Equivalent short name : -hn

-Organization: Identify the company which sent the message
Example : -Organization:"My Compagny Inc."
Equivalent short name : -o

-Priority: Change the "Normal" priority of the message by one of the following priority :
0 : the slowest, 1 : slow, 2 : normal, 3 : fast, 4 : urgent.
Example : -Priority:"4"
Equivalent short name : -p

-AttachedFile: Specify the name of the file to put in enclosure. Heavier is the file, slower is the email sent.
Example : -AttachedFile:"C:\patch.exe"
If the file is not found, the email sent continue, except if the parameter "-fqf" is found in the command line.
Equivalent short name : -af

-FromFile: Read the command line from the specified text file. The FIRST line of the file must contain the arguments, and only the first line is treated.
If batch environment variables are in the text file, they are interpreted.
Example : -FromFile:"C:\Args.txt"
Equivalent short name : -z

-TimeOut: Specify the maximum time, in milliseconds, beyond that point, the connexion is cut if no answer from SMTP server is received. If this parameter is not specified, default value is used.
Example : -tt:"5000"
Equivalent short name : -tt

-RCount: Specify the number of send try did by QuickMail before abandon.
By default, this parameter is set to 3.
Example : -rc:"10"
Equivalent short name : -rc

-Noretry: Abandon automatically without retry if the email could not been sent during the first try.
This parameter is identical to : -rc:"1".
Equivalent short name : -nr

-BodyTempFile: Specify that the body file (is -bf is used) is temporary and the file will be deleted after email sent.
The file is deleted ONLY if the email is sent with success.
Equivalent short name : -btf

-AttachedTempFile: Specify that the attached file (if -af is used) is temporary and the file will be deleted after email sent.
The file is deleted ONLY if the email is sent with success.
Equivalent short name : -atf

-Waittoclose: Wait that user press a key instead of closing automatically the window.
Equivalent short name : -w

-Ret: Display the QuickMail return code before stopping.

-fqf: (Force quit if not found) : Stop QuickMail if attached files (-af) or body file (-bf) are not found.
 

-> SMTP Server and Authentication

Some SMTP server requires user authentication before sending an email with a user name / password.
If you are in such case, you first need to :

++ Activate the LOGIN mode :

- login (or -lg)

++ Specify a user name and a password via :

- user (-usr)
- password (-pw)

For example, you have to add to your command line the following parameters if you need to authenticate yourself with the name "Maurice" and the password "Test" :

... -lg -usr:"Maurice" -pw:"Test"

-> QMail Variables

QuickMail variables are specifics strings which will be replaced by particular values.
They will be replaced either in the command line, or in the BODY text file (-bf).
For now, the QuickMail version implement following variables :

Variable

Value

%QDATE% Date in the formdd/mm/yyyy
Example : 21/12/2003
%QDATE2% Date in the formdd/mm/yy
Example : 21/12/03
%QDATE3% Long date in the form day_name date month year
Ex: Monday 12 December 2003
%QHOUR% Time in the form hh:mm
Example : 13:30
%QHOUR2% Time formatted as hh:mm:ss
Example : 13:30:28
%QHOUR3% Time formatted as US time AM/PM
Example : 7:03 PM
%QDATETIME% Date and time formatted as dd/mm/yy - hh:mm
Example : 21/12/2003 - 13:30
%QCNAME% Hostname of the PC used to send the email
Example : WEBLAF01
%QIP% IP address of the PC used to send the email
Example : 87.124.52.12
%QUNAME% User name which is used to send the mail
Example : ARA
   

 To take those variables into account, you have to use the following command :

Change of the variables in the command line
Parameter : -expandcmd (or -e)

Change of the variables in the file bodyfile (if -bf is used)
Parameter : -expandbf (or -ef)

Caution, variables MUST be spelled as described upper, and in upper case.
If you wish other variables, feel free to contact us following the link at the bottom of the current page.

-> Command line example :

Qmail -f:"me@free.fr" -h:"smtp.free.fr" -t:"custommer@ebsoft.com" -bf:"C:\Textes\CommandeRecue.txt" -s:"Dealing with your command"

Qmail -z:"C:\Mails\DefaultArgs.txt"

Qmail -f:"me@free.fr" -h:"smtp.free.fr" -t:"admin@lh.net" -b:"Backup finished at %QDATE%" -e

-> Use example for sending log file

mysoftware.exe /args >> C:\log.txt
qmail -f:"me@bar.com" -h:"smtp.bar.com" -t:"me@foo.com" -bf:"C:\log.txt" -s:"Results sent by MYSOFTWARE" -btf

-> Display of HTML file
If you want to display file with HTML format, do not forget to set the parameter "content-type" to "text/html", as follow :
...  -ct:"text/html"

Return code

Return code :
-0 : No problem encountered. The application stopped after sending the email(s).
Error return code :
-1 : Some files could not be found (AND the switch '-fqf' is present in the command line).
-2 : Some parameters sent to the application are badly formatted, invalid or incompatible, or the email preparation failed.
-3 : No parameter was sent to the application.
-4 : The Email could not be sent - QMail is not able to connect to the SMTP Server.
-5 : The Email could not be sent - error while sending the email.
-6 : Impossible to send the email because the maximum number of email sent is limited to 10. This error is obsolete with Qmail v2.0. Please, register !

Technical support

If problems are encountered, please post on the Astase forum by clicking here.
Finally, do not hesitate to send us your suggestion to improve the software by cliquing here.

To create your Batch and send your email simply and efficiently, we advice you to use PowerBatch, available on http://www.astase.com/products/powerbatch.

Astase QuickMail
©2003 A.REBOISSON / Astase
www.astase.com