SendMail 2.1 Readme
===================

Copyright (c) 2004 DATO Software

Author:
=======
  Jerinic Stasa: stasa.jerinic@dato.at

Idea:
=====
  Bernd Maierhofer: bernd.maierhofer@dato.at

Description:
============

SendMail is an application for bulk e-mails. It is a command line tool, which can be controlled by batch files or makefiles. 
All needed parameters (e.g. From, To,) to send e-mails can be defined either as command line parameters, an ini-file or in the registry.
Values for the parameter fields can be read in from defined text-files. Each text-file can include further text-files by containing a "$I file" line.
SendMail works with a SMTP-server to send e-mails and not with Exchange/Outlook.

  New in this version:
  ====================
  * Emails can be single send to To recipients, by setting the switch SINGLE_MODE to plus.
  * If the same Email address occurs in more fields (e.g. To and Cc), than only the first occurrence will be added to sending email.

  * Sending from body as HTML is possible in this version, by setting the switch HTML to plus.
  * If one file (e.g. to.txt) contains more than one same E-Mail address, all same addresses will be 
    deleted from this file, until the first occurrence.
  * This version support returns of error codes (Go to end of this file to see the possible error codes). 
    If someone uses SendMail from batch file, it is not more quite difficult to find out the failure 
    and parsing the log file is not more necessary.
  * Possibility to authenticate to SMTP Host is added.  
  * In last version the blank line in attachments file led to failure. 
    The failure is in this version corrected.
  * E-Mail checking corrected. Following E-Mail addresses was not correct in last version: 
    stasa.jerinic@dato.at or stasa@q.at. This version assists this input.

For example: 
sendmail /FROM=stasa.jerinic@dato.at /TO=c:\to.txt /CC=c:\cc.txt /REF=Meeting /MESSAGE=c:\message.txt ATTACHMENTS=c:\attach.txt

  PARAMETERS:
  ===========

  Parameters must be declared:
    /TO         : This switch sets the TO addresses (file path and file name is indicated).
    /MESSAGE    : This switch sets the message (file path and file name is indicated).
    /FROM       : This switch identifies the sender.
    /REF        : This switch sets the subject.
  Other possible parameters:
    /CC         : This switch sets the CC addresses (file path and file name is indicated).
    /BCC        : This switch sets the BCC addresses (file path and file name is indicated).
    /ATTACHMENTS: This switch sets the attachment (file path and file name is indicated).
    /HTML       : This switch sets the format of the body. The possible formats are text or HTML. Default is text.
    /HOST       : This switch sets the SMTP server. Default value is 'smtp.chello.at'.
    /PORT       : This switch sets the port address. Default value is '25'.
    /POP3_SERVER: This switch sets the incoming POP3 mail server.
    /POP3_PORT  : This switch sets the Port number of incoming POP3 mail server. Default value is '110'.
    /USER       : This switch identifies the POP3 user account.
    /PASS       : This switch represents the password used for the POP3 account.
    /SINGLE_MODE: This switch allows sending single Emails, which are headed in email field To.
    /?          : This switch gives an overview of all registered switches.
                  Immediately afterwards the application terminates.
    /RegOff     : This switch starts the readout from the registry in or out. Default value is '-'.
    /IniOff     : This switch starts the readout from the ini-file in or out. Default value is '-'.
    /CmdOff     : This switch starts the readout from the command line in or out. Default value is '-'.
    /RegPath    : This switch sets the path of the registry. 
                  Default value is '\Software\DATO\"Applicationname"\'.
    /IniPath    : This switch sets the path of the ini-file. Default value is "Application path".
    /IniFile    : This switch sets the name of the ini-file. Default value is '"Application name".ini'.
    /WriteIni   : This switch starts the writing of the registered switches into the ini-file.
                  Immediately afterwards the application terminates.
    /WriteReg   : This switch starts the writing of the registered switches into the registry.
                  Immediately afterwards the application terminates.
    /SHOWHIDDEN : This switch shows or hides the switches, which are registered with the special register method.
                  Default value is 'off'.

  Example for ini-file (Sendmail.ini is in the same path like the application):
  =============================================================================

    [PARAMETERS]
    MESSAGE=c:\sendmail\message.txt
    FROM=stasa.jerinic@dato.at
    REF=Meeting
    TO=c:\sendmail\to.txt
    CC=c:\sendmail\cc.txt
    BCC=c:\sendmail\bcc.txt
    ATTACHMENTS=c:\sendmail\attach.txt
    HOST=smtp.chello.at
    PORT=25

    For example the file "c:\sendmail\to.txt" looks like this:
      Jerinic Stasa <stasa.jerinic@dato.at>
      $I c:\sendmail\further_mail.txt
      GMX-Stasa <stale78@gmx.net>
      no_name@gmx.net

      The file "further_mail.txt" will be read and the included texts will be moved to the allocated fields.

   For example the file "c:\sendmail\attach.txt" looks like this:
      c:\Test.doc
      c:\download\indy\Indy_8_22_Src_D6.zip
     
  LOG File:
  =========

    SendMail logs when a e-mail was sent and if the sending process was successful or not.

    Example for a successfully sent e-mail:
      2002-07-11 16:36:54: started
      2002-07-11 16:36:54:   FROM: stasa.jerinic@dato.at
      2002-07-11 16:36:54:   TO: c:\sendmail\to.txt
      2002-07-11 16:36:54:   CC: c:\sendmail\cc.txt
      2002-07-11 16:36:54:   BCC: c:\sendmail\bcc.txt
      2002-07-11 16:36:54:   REF: Meeting
      2002-07-11 16:36:54:   MESSAGE: c:\sendmail\message.txt
      2002-07-11 16:36:54:   ATTACHMENTS: c:\sendmail\attach.txt
      2002-07-11 16:37:12:   The message is successfully sent!
      2002-07-11 16:37:12: terminated

    Examples for failed e-mails:
      2002-07-11 16:47:59: started
      2002-07-11 16:47:59:   FROM: stasa.jerinic@dato.at
      2002-07-11 16:47:59:   TO: Failure: Multiple occurrence of e-mail address Jerinic Stasa <stasa.jerinic@dato.at> 
                                 in file  c:\sendmail\to.txt.
      2002-07-11 16:47:59:   CC: c:\sendmail\cc.txt
      2002-07-11 16:47:59:   BCC: 
      2002-07-11 16:47:59:   REF: Hallo
      2002-07-11 16:47:59:   MESSAGE: c:\sendmail\message.txt
      2002-07-11 16:47:59:   ATTACHMENTS: c:\sendmail\attach.txt
      2002-07-11 16:47:59:   The message is not sent!
      2002-07-11 16:47:59: terminated

      2002-07-11 16:43:01: started
      2002-07-11 16:43:02:   FROM: Failure: The FROM e-mail address Jerinic Stasa <stasa..jerinic@dato.at> is incorrect.
      2002-07-11 16:43:02:   TO: c:\sendmail\to.txt
      2002-07-11 16:43:02:   CC: c:\sendmail\cc.txt
      2002-07-11 16:43:02:   BCC: c:\sendmail\bcc.txt
      2002-07-11 16:43:02:   REF: Hallo
      2002-07-11 16:43:02:   MESSAGE: c:\sendmail\message.txt
      2002-07-11 16:43:02:   ATTACHMENTS: c:\sendmail\attach.txt
      2002-07-11 16:43:02:   The message is not sent!
      2002-07-11 16:43:02: terminated

      2002-07-12 10:00:38: started
      2002-07-12 10:00:38:   FROM: stale78@gmx.net
      2002-07-12 10:00:38:   TO: Failure: The e-mail address Jerinic Stasa <stasa..jerinic@dato.at> 
                                 from file c:\sendmail\to.txt is incorrect.
      2002-07-12 10:00:38:   CC: c:\sendmail\cc.txt
      2002-07-12 10:00:38:   BCC: c:\sendmail\bcc.txt
      2002-07-12 10:00:38:   REF: Hallo
      2002-07-12 10:00:38:   MESSAGE: c:\sendmail\message.txt
      2002-07-12 10:00:39:   ATTACHMENTS: c:\sendmail\attach.txt
      2002-07-12 10:00:39:   The message is not sent!
      2002-07-12 10:00:39: terminated

  Error Codes:
  ============

    1 ... If FROM address is not correctly written or the address is missed.
    2 ... If declaration file for TO addresses is missed or one of the address is not correctly written.
    3 ... If one of the CC addresses is not correctly written.
    4 ... If one of the BCC addresses is not correctly written.
    5 ... The field SUBJECT is missed.
    6 ... The declaration of field BODY is missed.
    7 ... Failure on attaching the files.
    8 ... If the SMTP-PORT is not a valid number.
    9 ... If the connection fails. Possible sources of error are false SMTP port, SMTP host or authentication is needed.
    10 .. If the POP3-PORT is not a valid number.
    11 .. If the connection fails. Possible sources of error are false POP3 port, servername, username and/or password.
    12 .. File cant be opened.
    13 .. Other sources of error.

Contact:
========

  For further ideas or if you have any problems with SendMail please write an e-mail to: stasa.jerinic@dato.at.
  Please visit our homepage: www.dato.at
