• Errors and warnings in CMD mode
  • Sample batchfile with ErrorLevel in use
  • By Frans Wauters

    Download 51.31 Kb.
    Hajmi51.31 Kb.

    SMTPsend © 2002 by Frans Wauters

    SMTPsend is a tool to send mail without an email client installation.

    This tool works with command-line arguments what makes it ideal for batch routines, but now you can use a GUI interface to send a mail or create a script to automate sending parameters.
    SMTPsend server -t"To" -c"Cc" -h"Bcc" -s"Subject" -b"Body" -f"From" -a"Attachment"

    Server SMTP (relay)server or IP-Address
    -t”To” Destination address (*)

    -c”Cc” Copy Concatenate Destination (*)

    -h”Bcc” Blind Copy Concatenate Destination (*)
    -f”From” Transmitter of this email
    -s”Subject” Subject of the email

    -b”Body” Body or a filename containing the body

    -a”Attachment(s)” Filename(s) (*)
    -n | +n Disable or enable logging
    script=”Filename” Using a script with the parameters to send
    (*) For multiple addresses or filenames use an ";" as separator.

    A logfile called SMTPsend.log can be found in the same directory as the SMTPsend program.

    This is usually to find in the windows directory.

    Required parameters:
    Server address

    One (min. 1) destination address (-t”To”, -c”Cc” or –h”Bcc”)

    As command-line sample:
    SMTPsend smtp.myisp.com –t”info@company.com” –s”Sample mail” –b”body.txt”
    OR in batch (sample):
    SET SMTP=smtp.myisp.com

    SET SUBJECT=Backup process

    SET BODY=See attachment for backup logs

    SET ATT=Server1.log;Server2.log;Server3.log

    SET FROM=Backup@acme.com

    SET TO=ICT@acme.com

    SMTPsend %SMTP% -s”%SUBJECT%” –b”%BODY%” –a”%ATT%” –f”%FROM%” –t”%TO%”

    • Please de-install the previous when this occurs in the software list in the control panel’s “software” shortcut before installing this new version

    • This version will install the program in the standard windows directory so the program will be available from any directory because the directory is included in the search PATH variable


    • If you are using a version equal to 1.11 or higher, you can de-install this software by using the software icon in the control panel.

    • For the older versions you can delete the CAVO20NT.DLL, CAVO20RT.DLL and SMTPSEND.* files if they are on your disk. The old versions does not use an installer/de-installer.

    Version 1.00

    • First working version

    • Tested with several smtp and relay servers (ISP related)

    Version 1.10

    • Added the –h”Bcc” option for a Blind Copy Concatenated destination address

    • When the body is a valid filename, the content is used as the body text

    • Added the /? to display the command-line syntax

    • Tested with several smtp and relay servers (ISP related)

    Version 1.11

    • Fixed a V0 2.5 bug for sending large attachments

    • Version() function

    • Adding some logging functionality (in same directory as the executable)

    • Setup program for installing SMTPsend and to make a de-install possible trough the control panel: “software” shortcut

    • Tested with several smtp and relay servers (ISP related)

    • Tested with Microsoft Exchange 5.5 server (by using a vailid emailaddress for your domain for the From-parameter)

    Version 1.20

    • GUI functionality when starting the executable without any command-line parameters

    • Script functionality because the limited command-line size

    • Enhanced and configurable log-functionality

    • Saves some settings in the registry (ex. Smtp server) through GUI window after send

    Version 1.21

    • GUI - Checkboxes to indicate the values to save in the registry

    • GUI - Checkbox to close the application (or not) when a send operation was successful

    • GUI - Solved a problem with the hourglass after a send failure

    • GUI - Open the logfile fixed when the .LOG extention was not bind to an application

    • GUI - Errorboxes to cummunicate problems (See ErrorLevel in CMD mode)

    • CMD - Added ERRORLEVEL functionality

    Errors and warnings in CMD mode

    when SMTPsend (1.21+) is used on the commandline :

    ERRORLEVEL Description

    1. Send successfull

    2. Send successful but an attachment problem (warning)

    3. Send failure

    4. Send failure and an attachment problem

    5. Server/IP-Address not found

    6. No destination address specified

    Sample batchfile with ErrorLevel in use


    rem A parameterscript can be created trough the GUI interface
    smtpsend script=filename.txt
    IF Errorlevel 5 GOTO Err5

    IF Errorlevel 4 GOTO Err4

    IF Errorlevel 3 GOTO Err3

    IF Errorlevel 2 GOTO Err2

    IF Errorlevel 1 GOTO War1

    IF Errorlevel 0 GOTO Suc0

    GOTO Exit

    ECHO (%Errorlevel%) No destination address specified

    GOTO Exit

    ECHO (Error %Errorlevel%) Server/IP-Address not found

    GOTO Exit

    ECHO (Error %Errorlevel%) Attachment and Send failure

    GOTO Exit

    ECHO (Error %Errorlevel%) Send failure

    GOTO Exit

    ECHO (Warning %Errorlevel%) Attachment Warning, Send OK

    GOTO Exit

    ECHO (Success %Errorlevel%) Send OK

    GOTO Exit

    Future enhancements:
    Version 2.00

    • Option to authenticate to the smtpserver (if needed)

    It was not indenting to make an email client, but just a tool to make life easier for IT support or freaky command-line users.

    Download 51.31 Kb.

    Download 51.31 Kb.

    Bosh sahifa

        Bosh sahifa

    By Frans Wauters

    Download 51.31 Kb.