Welcome

NetMailBot 5.0
Send and Receive Command Line SMTP and POP3 Email on Windows
Send SMTP and receive POP3 email on Windows through the DOS command line with the most flexibile and customizable product on the market today.

Overview

Features rich message formatting (HTML Email), multiple recipients & attachments, mail merge, import from a database, dynamic attachments, directory monitoring, auto ZIP compression download email message parts and attachments, auto reply and auto forward messages, and run as a Windows Service.

Getting Started

If this is your first time using NetMailBot and you would like to start right away, try our examples .

Keeping Up-To-Date

For the most up-to-date help, visit the NetMailBot, where you can download the latest version of this help file, download NetMailBot in PDF format - suitable for printing, and other resources.


Benefits
         Next Topic

Deliver and Receive Email with Ease

Numerous NetMailBot features lighten the workload on you. And, NetMailBot is easy to install. Complete documentation is online and included in the installation package, with examples that are easy to follow and get you up and running in no time.

Schedule and Automate Sending

NetMailBot automates many tasks involved in sending emails via your SMTP server:

  • Use NetMailBot to send individual emails or tens of thousands of emails to one, a few, or as many recipient email addresses as you wish, perhaps taken from a database via an ODBC connection
  • Use the Mail Merge features to personalize each email sent for each recipient using any data from your chosen data source. Mail Merge and personalization give you added professionalism - don't just send a message addressed to "aks439@hotmail.com", personalize it with your customer's first and last name.
  • Send emails with attachments listed explicitly or matching a filemask pattern in some directory
  • Use NetMailBot to watch directories for files to automatically send them as attachments, either ZIP compressed or uncompressed
  • Use NetMailBot with the Windows Scheduler to automate sending on a scheduled basis. Click here for an example.
  • Incorporate NetMailBot into larger systems by calling it from external programs

Download Email, Forwarding, and Auto-Reply

NetMailBot easily handles the receiving end of automated email communications as well:

  • Retrieve email messages from your POP3 email server and save them to your hard disk for processing.
  • Forward email messages with complex MIME parts and attachments.
  • Monitor your POP3 email account, and automatically send replies.

Create rich message formatting

NetMailBot gives you control over the type and appearance of your email message bodies:

  • NetMailBot supports both HTML and plain text formatting to ensure your email recipients have the ability to read your messages regardless of their email client. Click here for an example.
  • HTML emails give you greater artistic control. Why send plain text when you can send HTML formatted messages? Not only can you use HTML tags, e.g. <H1>, <font>, etc., but you can also embed:
  • Images
  • Sound
  • Javascript
  • Macromedia Shockwave presentations
  • Anything else that can be viewed in a browser

Click here for examples.

Easier campaign administration

Sending mass email campaigns to keep your customers informed?

  • Advanced options like logging and debugging give you the ability to easily identify mail server errors or other problems.
  • Use your own SQL query to specify email recipients without having to first create a database extract. Click here for a code example of specifying a SQL query, here for information on this feature and here for strategies on mass mailings.

Improve performance

NetMailBot is written in high performance C++ and has been optimized for speed. Integrated database functionality delivers faster results than using ADO for VB or ASP. See our FAQs for some information on typical performance when sending tens of thousands of personalized emails at a time.


How to Order

Purpose

Please see the following URL for information on easy, instant, and secure online ordering of NetMailBot and our other products as well as Annual Support Agreements:

https://www.exclamationsoft.com/exclamationsoft/order/order_info.asp

All purchases include:

  • Unconditional 30-day money-back guarantee
  • 60 days of unlimited email support
  • No hassle license "trade-up" policy

You can order online with a major credit card, or also by phone, check, purchase order, wire transfer, fax or postal mail, or through one of our Resellers. The link above contains all the details for both secure online ordering and other means.


System Requirements

Purpose

This table lists both hardware and software system requirements for NetMailBot.

General System Requirements

Operating System

  • Windows® 98/98 SE
  • Windows® Me
  • Windows® NT 4.0 SP4 Workstation/Server
  • Windows® 2000 SP4 Professional/Server/Advanced Server
  • Windows® XP Home/Professional
  • Windows® Server 2003 Standard Edition/Enterprise Edition/Datacenter Edition

CPU

Minimum: 200 MHz Pentium®/AMD
Recommended: Pentium® III or AMD Athlon 1.0 GHz processor or faster

Memory

Minimum: 32 MB Minimum
Recommended: 64 MB

Hard Drive Space

3 MB Minimum

Video

Any Windows®-compatible video card
Recommended setting at least 640 x 480, 16 colors

Sound

Windows®-compatible sound card - recommended but not required

Other Requirements

MDAC (Microsoft Data Access Components) if using NetMailBot database features

Version 2.6 or higher, 2.8 is recommended. See the following link to download:

http://msdn.microsoft.com/data/downloads/updates/default.aspx#MDACDownloads

You may have already have a version installed. Find your Windows OS in the list below to see what Default MDAC version comes with it:

  • Windows Server 2003 - 2.8
  • Windows XP - 2.7
  • Microsoft SQL Server 2000 Service Pack 3a - 2.71 SP1 Refresh
  • SQL Server 2000 SP2 - 2.6 SP2
  • SQL Server 2000 SP1 - 2.6.1
  • Windows 2000 Service Pack 3 - 2.5 SP3
  • Windows 98/ME/NT should download and install the newest version of MDAC.

Network Access

  • Internet connection
  • TCP/IP must be installed (If you are connected to the Internet, then you most likely have TCP/IP installed)
  • SMTP server address, e.g. mail.domain.com, smtp.domain.com (Ask your ISP or systems administrator)
  • Proxy client software if behind a proxy server. (Ask your systems administrator if you are behind a proxy server)
  • Firewall Port 25 must be open for inbound and outbound traffic.(Ask your systems administrator if you are behind a firewall)


Support

How to Obtain Support

NetMailBot is fully supported through email and our online support system: http://www.exHelp.com which is available Monday through Friday 9am - 5pm Eastern time in the United States of America.

Response times to support requests generally range from 15 minutes to 2 hours. Please allow up to 24 hours to respond during the weekdays and 48 hours during the weekend.

We do not offer telephone support.

We need your help!

ExclamationSoft is committed to providing you with the best software; and because of that commitment, we ask that you inform us when you find a problem or if you have a suggestion. It not only helps us make a better product, but it will ultimately help you and other people using our product.

ExclamationSoft Forums

Click here (http://www.exDiscuss.com) to discuss NetMailBot in the Exclamationsoft Forums. In the forums, we keep you up to date in new developments with the product, current enhancement requests from users like you, and users helping users through question and answer.

About Support

Technical support is available for all of our products.

The trial versions are supported for 30-days while you evaluate our products.

The fully licensed versions are supported for 60-days from the date of purchase without an ASA (Annual Support Agreement) and for 1 year with an ASA.

Please see How to Order for information on ordering NetMailBot Annual Support Agreements along with NetMailBot licenses.

Please direct all support requests to our online customer support system at http://www.exhelp.com .


Revision History

Purpose

This table presents a list of changes since NetMailBot 2.0. Check here to find out if a problem you are having has been solved in a subsequent release.

Release - Date

Description

4.0.8 - August 11, 2004

  • Bug Fix: Fixed bug that prevented -watchmoveto from moving files from the source to the destination directories..
  • Bug Fix: Changed parameter -delimeter to the correct spelling -delimiter.
  • Change: If -chars is specified with 0 (-chars 0), text is not wrapped in message parts.

4.0.7 - July 1, 2004

  • Bug Fix: Fixed bug that prevented plain text message bodies from forwarding.

4.0.6 - June 15, 2004

  • Bug Fix: Fixed problem with parsing messages that are not multipart, including messages that do not contain "Content-type" in the message header.
  • Bug Fix: Message end boundary added to messages with text and html message parts (no attachments). This bug was introduced in a previous version.
  • Bug Fix: If using quiet mode (-q) the header, footer, and help and all other text is not shown, regardless if it is the Pro or Trial version.
  • Bug Fix: When using -cclist or -bcclist, emails are addressed multiple times.
  • Bug Fix: Using -watchmoveto will first attempt to delete a file with the same name in the move-to directory before moving the file. Corrects a problem where the file is not moved from the watch directory to the move-to directory.

4.0.5 - April 26, 2004

  • Enhancement: Added parameter -loadurl. When specified, no other parameters are required and the url specified will be loaded.
  • Bug Fix: Corrected problem with parsing and saving attachments (when downloading email) from emails generated by Outlook.

4.0.4 - March 12, 2004

  • Bug Fix: If using a list of to addresses, CC and BCC addresses added are ignored. Corrected problem. You can now add email addresses with -cc and -bcc; and, additionally email addresses can be added with -cclist and -bcclist. If specifying -ccfriendly, it will only be added to the first email address specified with either -cc or -cclist, but not the the remaining email addresses on the list.
  • Enhancement: Added parameter -chars (-cpl) which sets the number of characters per line for a plain text message part. The default is 72. Set this number to a value higher than 72 if lines are wrapping in the email client.

4.0.3 - February 17, 2004

  • Bug Fix: Using the -embed parameter, changes a URL specified with -bodyfile to all uppercase, causing some web servers to return a 404 due to case sensitivity.
  • Bug Fix: When sending an HTML email, with embedded images and an attachment, an extra MIME boundary was being added which caused the attachment to not show up when received and viewed in the email client.
  • Enhancement: Save all unrecognized message parts as an attachment.
  • Change: HTML used for the message body have image names with a full path name, e.g. <img src="c:\images\image.gif"> and not <img src="image.gif">

4.0.2 - December 8, 2003

  • Bug Fix: -bcc parameter was addressing the recipients as "cc" and not "bcc". Corrected.

4.0.1 - November 21, 2003

  • Bug Fix: Downloading of multipart messages with a text and html message body were not being saved as text_plain[message number].txt and text_html[message number].html. Instead they were only being saved as text_plain.txt and text_html.html. This has been fixed.
  • Change: Changed the structure of multipart-MIME messages for better compatibility with some mail servers.

4.0 - October 23, 2003

  • Enhancement: Added ability to receive email from a POP3 mail server. New parameters include:
    • -receive: Instructs NetMailBot to receive.
    • -popuser: Specifies the email account user name.
    • -poppassword: Specifies the email account user password.
    • -popserver: The name of the POP3 email server.
    • -popstatistics: Retrieves the number of messages and the total number of bytes the email messages are using for the specified email account.
    • -popreceive: Specifies a message to retrieve. Each part of the email message, body and attachments, are saved to the hard drive. Specify a message number after this parameter for a single message. If you do not specifiy a message number, all messages will be retrieved.
    • -popheader: Specifies a header to retrieve. Specify a message number after this parameter for a single header. If you do not specifiy a message number, all messages will be retrieved.
    • -popdelete: Specifies a message to delete. Specify a message number after this parameter to delete a single message. If you do not specifiy a message number, all messages will be deleted.
    • -popdirectory: Specifies the directory name to save retrieved attachments, email message bodies, and other MIME parts. If not specified, then a directory named \"pop\" is created and used under the system temporary directory.
    • -popcleanup: Switch used to force all files in the -popdirectory to be deleted before processing. This is useful to keep the -popdirectory from growing too large.
    • -popforward: Switch used to forward email to one or more email addresses. Can be used in combination with any of the other parameters that normally send email.
    • -popwatch: Switch used to monitor an email account and perform specific actions indefinitely.
    • -popwatchexit: Specifies that NetMailBot should exit a watch, after retrieving at least one email message.
    • -popwatchwait: Specifies the number of milliseconds to wait between monitoring an email account for new messages.
  • Enhancement: Added parameter -nolog to prevent a log file from being created.
  • Enhancement: NetMailBot now includes a helper application for running as a Windows Service
  • Enhancement: Added new parameters for dynamic attachments, including directory watch features:
    • -filedatebefore: Only attach files if date is before specified date.
    • -filedateafter: Only attach files if date is after specified date.
    • -filedateis: Only attach files if date is the specified date
    • -filesizelessthan: Only attach files if size is less than number in bytes specified.
    • -filesizegreaterthan: Only attach files if size is greater than number in bytes specified.
    • -filesizeequal: Only attach files if size is equal to the number in bytes specified.
  • Enhancement: Parameters -to, -cc, and -bcc now accepts multiple email addresses on the command line separated by a single space. For example: -to email1@domain.com email2@domain.com

3.0.4 - October 15, 2003

  • Enhancement: Added a unique message id for each message sent to prevent mail filtering software, such as Declude, from flagging NetMailBot generated email as SPAM.
  • Bug Fix: Changed sub-headers for embedded images to more tightly conform to the RFCs. Without this fix, Eudora would show the embedded image headers as part of the message body.
  • Bug Fix: Corrected resource leak with HTML email embedded images that occurs when sending more than 100 messages.

3.0.3 - June 24, 2003

  • Bug Fix: Corrected problem with quoted-printable encoding of HTML message bodies.

3.0.2 - June 13, 2003

  • Enhancement: Added parameter: -config: Specifies a configuration file to load commonly used parameters from. NetMailBot will load parameters from the command line/batch file first, then load parameters from the configuration file. Parameters in the configuration file do not override, but add-to the parameters specified on the command line or in a batch file. As with batch files, all parameters cannot be separated by a carraige return.
  • Enhancement: Added parameter: -sendwait: Sets the number of milliseconds to wait after sending a message. Useful for some mail servers that prevent message sending from causing an overload
  • Enhancement: Added parameter: -reconnectaftersend: Specifies that after sending a message to disconnect then reconnect.
  • Enhancement: -zip parameter now works with dynamically added attachments, even when using mail merge.
  • Enhancement: Mail Merge feature can now handle dynamic attachments with wildcards, e.g. c:\temp\*.txt or c:\documents\*.*
  • Enhancement: Increased performance: using a new encoding scheme that increases performance by up to 50%.
  • Enhancement: HTML message parts are now encoded quoted-printable.
  • Enhancement: Abbreviated parameters/switches. Almost all parameters and switches now have abbreviations. Check the online Parameter guide for more details.
  • Enhancement: -attachment can now handle multiple filenames to attach - separate each filename with a space. Example: -attachment file1.txt file2.txt file3.txt...
  • Bug Fix: Changed content type for PDF files from application/octet-stream to application/pdf. Some email readers specifically recognize this content type.

3.0.1 - May 20, 2003

  • Bug Fix: If specifying -watchdir and -tolist (or any multiple recipients), the list of recipients is cleared and subsequent sends have no recipients. This has been fixed.
  • Bug Fix: If sending without the -failsafe parameter, two 'DATA' commands are sent, which can cause some mail servers to reject a message and close the connection. This has been fixed.
  • Bug Fix: Prevent error when pressing Ctrl-C during operation.
  • Bug Fix: Corrected order of multipart/alternative messages to display in order of richness as described in RFC 1521
  • Bug Fix: Changed .jpg attachments to be of content type image/jpeg and not image/jpg
  • Bug Fix: Changed from using content type of multipart/mixed to multipart/related to better support embedded images in HTML formatted emails.
  • Enhancement: Added parameter -dbusecolumnindex. Specifies that a column index is used in place of a column name, e.g., -dbreplacementids "<<first_name>>=2,<<last_name>>=1,<<company>>=3". Applies to -dbreplacementids and -dbemailcolumn
  • Enhancement: -debug mode will now log the message body whether or not specifying -test. Previously if using -test and -debug, the message body was never logged. This has been enhanced so that it is easier to test using the mail merge features.

3.0 - April 10, 2003

  • Enhancement: Added parameter: -attachmentdir: Specifies a directory to add attachments from. Use with -zip to compress files into one zip file and attach. Use with -filemask to specify only certain files, e.g. "*.txt"
  • Enhancement: Added parameter: -filemask: Specifies a file mask. By default, the mask is *.* - all files.
  • Enhancement: Added parameter: -watchdir: Specifies a directory to watch for files to send as attachments. NetMailBot will continuously monitor the directory and until the key combination CTRL-C is pressed. Requires -watchmoveto or -watchdelete parameter to be specified.
  • Enhancement: Added parameter: -watchdelete: Switch used with -watchdir parameter that specifies that files should be deleted after they are sent.
  • Enhancement: Added parameter: -watchexit: Switch used with -watchdir to exit after files are sent after attaching files in the watch directory.
  • Enhancement: Added parameter: -watchmoveto: Switch used with -watchdir to exit after files are sent after attaching files in the watch directory.
  • Enhancement: Added parameter: -watchwait: Specifies the number of milliseconds (1/1000 of a second) to wait between checking the watch directory for new files to send.
  • Enhancement: Added parameter: -zip - Switch/Parameter used to compress all attachments into a single zip file as a single attachment. Specify a filename after this parameter to name the attachment; otherwise, "attachment.zip" is used.Works with -watchdir parameters, -attachment, -attachmentdir, and -attachmentlist. This feature is not available to attachments added through mail merge.
  • Enhancement: New mail merge field: -attachment. Specify a replacement id after the -attachment parameter (-attachment "<>") when using mail merge to dynamically attach files from a database.

2.3.6 - April 2, 2003

  • Bug Fix: Correct resource leak when sending that only appears when sending to large lists.
  • Bug Fix: Correct endless loop that would occur if using failsafe feature and restricting the recipient limit to 1 - which is automatic if using mail merge features.
  • Bug Fix: If a line in the message body begins with a period ".", it is now "encoded" with an extra period so that mail readers can decode it properly.

2.3.5 - February 24, 2003

  • Bug Fix: Added more logic to email address verification to handle responses not expected from some mail servers.
  • Bug Fix: Correct date/time in mail message header to show a "+" sign for the number of hours of departure from GMT time, e.g. "+0500"
  • Bug Fix: Removed extra line at the top of plain text email message bodies.

2.3.4a - February 12, 2003

  • Bug Fix: Fixed problem, introduced with version 2.3.4, for email address verification that prevented some email addresses from being verified properly.

2.3.4 - February 7, 2003

  • Bug Fix: Fixed timing issue with some mail servers that would cause NetMailBot and the mail server to get out of sync, which eventually causes an unexpected disconnection.
  • Bug Fix: If message contains: html body, plain text alternate body, and an attachment, the attachment would not appear correctly in some email readers, e.g. Outlook, but would appear in others, e.g. Outlook Express.
  • Bug Fix: Preview mode was returning an error. It no longer returns an error.
  • Bug Fix: Preview mode does not require -to, -from, or -server parameters. It does require the -bodyfile parameter.
  • Change: Message "recipient limit set" even if this parameter is not specified. Also removed other messages that state certain parameters are "set"

2.3.3 - November 17, 2002

  • Enhancement: Added new parameter: -customheader. Allows the adding of a string to the header of the email. For example, you can specify "Reply-To: email@domain.com;Return-Path:email@domain.com". Separate multiple lines with a semicolon.
  • Bug Fix: If using a stored procedure with the -dbquery parameter, -personalize, and -dbuseaddressee is set to "to", the -to address is not ignored as it should be. This has been fixed.
  • Bug Fix: HTML emails that contain https:// links were being improperly changed so that the links did not work. This has been fixed.
  • Bug Fix: Email address verification was incorrectly reporting some email addresses to be good. This has been fixed.
  • Bug Fix: Corrected problem with authentication incorrectly reporting success.
  • Bug Fix: Corrected problem when connecting to mail server such as Groupwise. If the mail server does not understand EHLO command, then HELO command is used.
  • Bug Fix: Corrected ordering of text based MIME parts so that the plain/text comes before html/text MIME parts. This corrects the issue with browser based email that strictly conforms to the RFCs.

2.3.2 - July 23, 2002

  • Bug Fix: Corrected bug that caused -fromfriendly to not work and message sending to fail.

2.3.1 - July 3, 2002

  • Enhancements:
    • Added parameter "-failsafe". When parameter is specified, NetMailBot will re-establish a connection to the mail server if it is disconnected while sending a message.
    • Added Alternate Body and CC Friendly to list of fields that can be personalized.
  • Bug Fix: Changed mail headers so that "boundary" is only included if the content-type is multipart/*. This helps some mail readers that do not ignore boundary for text/* content-types.

2.3 - May 10, 2002

  • Enhancement: Added the ability to verify only one email address with corresponding return codes:
    GOOD - 16
    BAD - 17
    SUSPECT - 18
    If verifying multiple email addresses, NetMailBot will still return SUCCESS even though some email addresses may have failed. Check the good/bad/suspect email files. Example: netmailbot -verify info@exclamationsoft.com
  • Enhancement: Verification no longer requires any parameters other than the -verify and email address or the use of the -dsn parameters or the -tolist parameter. There are no "QUICK" or "EXTENSIVE" modes. If not verifying one email address, an extensive check is performed of all the email addresses.
  • Enhancement: Only -from parameter is required instead of -from, -subject, -to, -server
  • Enhancement: -logsuspectemail. Added a "suspect" email file for email addresses that cannot be verified because the mail server for that email address would not allow verification.
  • Enhancement: -appendsuspect. Specify this switch to append to the suspect email file. By default, the suspect email log file is re-created each time NetMailBot is executed.
  • Enhancement: -dbquery. Added the dbquery option for the ability to specify the query to run against the database when using the database commands. Requires: -dsn, -dbemailcolumn.
  • Enhancement: -rulesfilename. This parameter has been removed.
  • Enhancement: -htmlbody. The message body explicitly contains html tags and formatting.
  • Enhancement: -from. (Optional) Used when verifying one email address. When verifying email addresses, some mail servers require a FROM address to know who is asking for verification. If not specified, the email address being verified is used as the from address.
  • Enhancement: -dnsservers. (Optional) Specifies one or more DNS servers used for email address verification. Seperate multiple server addresses with a comma. If this property is not specified, then NetMailBot will search the registry for addresses.
  • Bug Fix: While addressing a message the "MAIL FROM" in the header of the message did not have the characters <> around the email address when an at symbol(@) is present. This is important for servers that allow profiles, e.g. Lotus Notes and Exchange. This has been fixed.
  • Bug Fix: CC friendly names added a space in front of the friendly name. This has been fixed.
  • Bug Fix: In the message header, the time zone for the date was in the long format, e.g. Eastern Time Zone. Some mail servers, such as MS Exchange would incorrectly parse this and show the sent time incorrectly. The time zone has been changed to reflex the number of departure hours. For example, the Eastern Time Zone in the United States is -0500 from GMT time ( 0000 ).

2.2.2 - July 10, 2001

  • Bug Fix: Friendly names are not included if they are blank. Blank friendly names were being inserted which does not follow the standard.
  • Bug Fix: Corrected error when using DSN and DBuseaddressee is "to", could not specify recipient limit of 1.

2.2.1

  • Enhancement: -connectiontimeout - set the connection timeout in milliseconds.
  • Enhancement: -generaltimeout - set the gereral timeout in milliseconds.
  • Bug Fix: Friendly names are now surrounded in quotes.
  • Bug Fix: The content type for html emails was not being properly set. Fixed.

2.2

  • Enhancement: -mimetype override the mimetype of the body.
  • Enhancement: Authentication is referred to as Authorization.
  • Bug Fix: Advertisement was growing with each send session.
  • Enhancement: Changed delay time from 7.5 seconds to 3.
  • Enhancement: -nofixhtml - prevents a bodyfile with html from being "fixed".
  • Change: -tofriendly is handled differently when addressing the message. The friendly name is only specified in the actual header of the email message and not as part of the send/receive dialog with the mail server. This will solve a problem with some SMTP servers.
  • Enhancement: The next three enhancments allow db connectivity without a tabledef.ini file.
  • Enhancement: -dbtable - Sets the name of the database table to query when using -dsn
  • Enhancement: -dbemailcolumn = Sets the name of the column name in the table specified with -dbtable, that contains the email address
  • Enhancement: -dbreplacementids = Specifies replacement identifiers used with -personalize
  • Enhancement: -dbuseaddressee = Specifies which addressee should be used. Valid addressees are: to, cc, and bcc.
  • Enhancement: -personalize will do replacements when specifying -cclist or -bcclist. Previously, only -tolist was replaced.


Examples

This section includes examples categorized into the various functional areas of NetMailBot.


Introduction

Summary

The following examples demonstrate the power and flexibility of NetMailBot. If you are new to using DOS batch files, we recommend starting with Getting Started . If you are already familiar with using the DOS command line and writing batch files, start with SMTP Email Sending or POP3 Email Receiving .

Prerequisites

Using these examples requires basic working knowledge of creating and editing DOS batch files. See the How to Create a DOS Batch File topic for a brief introduction, and see the More Information on DOS Batch Scripting topic for pointers to more information on DOS batch scripting.

In order to make use of the ZIP files containing the artifacts pertaining to each example, you will need a ZIP archive program to extract the contents to your local hard drive.

Parameters, Switches, and Options

In addition to these examples, our Parameters page includes in-depth information and small examples for each of the parameters that NetMailBot has to offer.

Reference

See also the Reference section, which contains various topics, such as how to create a DSN.

Need a Specific Example?

If you don't see a specific example of what you are trying to accomplish, let us know and we'll be happy to either create an example for you or guide you through the process. Go to http://www.exhelp.com to contact a technical consultant.


Getting Started

Here we introduce some basic knowledge of interacting with the DOS command window and creating DOS batch files required to be able to run NetMailBot.


How to Open a DOS Command Window

DOS Command Windows

A DOS Command Window, also known as a:

  • Command Line
  • Command Line Prompt
  • Command Prompt
  • DOS Prompt
  • DOS Window
  • DOS Command Line
  • DOS Command Window
  • MS-DOS Prompt
  • Command Interpreter

... is a tool built-in to all modern "GUI-based" Windows operating systems and can be accessed easily.

To Open a DOS Command Window On Windows 95 / 98 / Me:

  1. Click on the Windows "Start" button
  2. Select "Programs"
  3. Select "MS-DOS Prompt"

To Open a DOS Command Window On Windows NT / 2000 / XP / 2003:

  1. Click on the Windows "Start" button
  2. Select "Programs"
  3. Select "Accessories"
  4. Select "Command Prompt"

Additional Information

Both your Windows OS and the Internet have plenty of information on using the DOS Command Window and on DOS batch scripting in general; see also the More Information on DOS Batch Scripting topic for a pointer to more information.


How to Create a DOS Batch File

Command Line Invocation

Running programs in a DOS Command Window straight from the command line has the limitation that you can only issue one command - you type the name of the program, then any control parameters and options, and then terminate the command line by pressing the Enter key at the end. This runs the program with the options you specified.

For example, NetMailBot is invoked directly on the command line ("C:\>") according to the following:

NetMailBot -to {To} -from {From} -subject {Subject} -server {Name of your SMTP Server} [Optional Parameters] (Enter)

Note that there is no newline (press of the Enter key) until the end; if the above example takes two physical lines on your screen, it's due to word wrap.

If you just want to use NetMailBot in simple situations, this might be acceptable. But if you use a lot of parameters and options, you don't want to have to type them all in each time you want to run NetMailBot. Also, if you have more complex situations, when the context of NetMailBot's use depends on other factors and decisions that have to be made "on the fly", then you need a "little program" that calls NetMailBot within the context of its own execution.

Thus, you need a batch file!

What is a batch file?

Batch files are special files, often called scripts, that allow you to run programs from the DOS Command Window. Batch files are useful for storing sets of commands that are always executed together, in sequence, because you can simply enter the name of the batch file as the "command" instead of entering each command individually.

In DOS, batch files end with a .BAT extension. The process of creating them is often called DOS batch scripting.

A Simple Example

Suppose the following text is saved in a file called "mybat.bat":

@ECHO ON

REM This is an example .BAT file output...

@ECHO OFF

REM Nothing fancy...

dir

This batch file contains two comments (or remarks, indicated by "REM") that just provide documentation for either the author or the user of the file. The first one is "echoed" to the screen because it is embedded inside two @ECHO commands that first turn on echoing and then turn it off. Everything between the @ECHO commands is displayed on the screen during the script's execution. After the second comment, there is a simple DOS "dir" command which, as usual, lists the contents of the current directory.

Note that the individual commands or comments are separated by newlines, that is, pressings of the Enter key.

Running the batch file executes the commands in "mybat.bat" sequentially.

Invoking the Batch File

A batch file can be run in two ways:

  • Straight from the command line
  • Double-clicking the file's icon in a Windows Explorer window (or via "My Computer")

For our example above, typing "mybat" or "mybat.bat" at the DOS command line yields the following output:

Double-clicking the batch file icon (see below) will open up a DOS Command Window, invoke NetMailBot within it according to the batch file, and then close the window when everything is done. Depending on how short your script is, if you blink, you might miss it!

A batch file icon:

See the More Information on DOS Batch Scripting topic for more information.


SMTP Email Sending

NetMailBot's email sending functionality, in which you use a Simple Mail Transport Protocol server to send the mails generated with NetMailBot, is exemplified in this section.


Prerequisites

Before you can send email with NetMailBot, you need to have three things:

  • The name of your email server, or SMTP server. For example, if your ISP (Internet Service Providor) is Earthlink, the SMTP server is smtp.earthlink.com or mail.earthlink.com. If you don't know your SMTP server name, contact your ISP or network administrator to find out.
  • An email address to send the email to. For example, jdoe@hotmail.com or, for testing purposes, your own email address.
  • An email address to send the email from. For example, msmith@hotmail.com or, for testing purposes, your own email address.

Note: Individual examples may list additional requirements, e.g. having Microsoft Excel available.


Basic Examples

Here we introduce the basics of using NetMailBot, starting with sending your first email. From there we cover the basics of creating log files, sending plain text message bodies, sending mail to multiple recipients, SMTP server authentication, addressing of email recipients ("To:", "Cc:", and "Bcc:") and use of "friendly" names in email headers.


Introduction: Sending Your First Email

The NetMailBot Command Line

Recall that you will need at minimum three things to send an email:

  • An email address to send the email to. Example, jdoe@hotmail.com or your email address.
  • An email address to send the email from. Example, msmith@hotmail.com or your email address.
  • Your email server address. Example, mail.domain.com or your email server address. If you don't know your SMTP server name, contact your ISP or network administrator to find out

In a DOS Command Window, type the following, filling in your particular details for the placeholders below:

NetMailBot -to {your email address here} -from {your email address here}

-server {your SMTP server name here} (Press Enter)

This is the simplest invocation of NetMailBot possible - the email sent will have no subject nor any actual message body.

In this example we are not using a batch file, just a straight command line invocation.

The Results

Once you type the above and press the Enter key, you will see something similar to to the following:

Connecting to mail.server.com

Preparing message

Adding TO(1): info@server.com

Sending message

Sending Message: 100%

Disconnecting

Mail sent successfully to 1 recipients

If you see the text "Mail sent successfully", then you have successfully sent an email to the email address you entered.

If you do not see the success message, check the error message that NetMailBot displayed.

  • Did you enter the correct email server name?
  • Did you type the to and from email addresses correctly?

If you are still having problems, contact ExclamationSoft support for assistance .


Simple Test Send with Logging

Purpose

This example demonstrates how to send a single email while logging the results.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • SimpleSendWithLogging.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost

This is (with the exception of the logfile) the simplest invocation of NetMailBot possible - the email sent will have no subject nor any actual message body. The results of the invocation will be logged to a logfile in the path specified.

Steps

  1. Unzip the SimpleSendWithLogging.zip file. This will produce a directory called "SimpleSendWithLogging". Open this directory.
  2. Open Notepad and edit the batch file "SimpleSendWithLogging.bat". Change the values of the parameters -to, -from, and -server to your own email address and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and, upon finishing, the email address specified with the -to parameter should receive a single email.


Plain Text Message

Purpose

This example demonstrates how to send a single email with a plain text message body.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • PlainTextMessage.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost -subject "Plain Text Message" -body "This is a plain text message sent with NetMailBot"

Steps

  1. Unzip the PlainTextMessage.zip file. This will produce a directory called "PlainTextMessage". Open this directory.
  2. Open Notepad and edit the batch file "PlainTextMessage.bat". Change the values of the parameters -to, -from, and -server to your own email address and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and, upon finishing, the email address specified with the -to parameter should receive a single email.


Multiple Recipients

Purpose

This example demonstrates how to send a single email to more than one recipient.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • MultipleRecipients.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com another@exclamationsoft.com -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost -subject "Plain Text Message" -body "This is a plain text message sent with NetMailBot"

Steps

  1. Unzip the MultipleRecipients.zip file. This will produce a directory called "MultipleRecipients". Open this directory.
  2. Open Notepad and edit the batch file "MultipleRecipients.bat". Change the values of the parameters -to, -from, and -server to two test recipient email addresses of your choosing, your email address, and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive an email message.

NOTE: If you use the same recipient email address twice in this example, e.g. "test@testcompany.com", the

address will be listed twice in the "To:" field of the email received by the recipient. That is, the email header will

look like:

From: test@mymail.com

Date: Thursday, July 01, 2004 2:52 PM

To: test@testcompany.com; test@testcompany.com

Subject: Plain Text Message

However, the recipient will only get one email. Such is the nature of SMTP!


Multiple Recipients Using -tolist

Purpose

This example demonstrates how to send an email to multiple recipients using -tolist. Each recipient listed in a text file will receive its own email addressed to that recipient. .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • MultipleRecipientsTolist.txt - The text file that contains a comma delimited list of email addresses.
  • MultipleRecipientsTolist.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -tolist "MultipleRecipientsTolist.txt" -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost -subject "-tolist example" -body "This is a plain text message sent with NetMailBot" -recipientlimit 1

Steps

  1. Unzip the MultipleRecipientsTolist.zip file. This will produce a directory called "MultipleRecipientsTolist". Open this directory.
  2. Open the "MultipleRecipientsTolist.txt" text file.
  3. Change all of the email addresses to your email address. The email addresses can all be the same.
  4. Open Notepad and edit the batch file "MultipleRecipientsTolist.bat". Note these important parameters used in the batch file:

  • Note the use of -tolist. This instructs NetMailBot to use the text file specified after this parameter as the list of email addresses.
  • Change the parameter: -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server
  • Note the use of -recipientlimit 1. This instructs NetMailBot to limit each email message sent to one recipient.

  5. Invoke the batch file.
  6. NetMailbot should start up and, upon finishing, the email addresses specified in the list should each receive an email message.

NOTE: If you use the same recipient email address twice in the tolist, e.g. "test@testcompany.com", the use of -recipientlimit 1 forces NetMailBot to only put one email address in the "To:" field at a time. Thus, NetMailBot will send as many email as there are addresses listed in the tolist. In this example, "test@testcompany.com" would therefore receive two identical emails, each with a header looking like the following:

From: test@mymail.com

Date: Thursday, July 01, 2004 2:52 PM

To: test@testcompany.com

Subject: Plain Text Message


SMTP Server Authentication

Purpose

In this age of proliferation of "Spam", SMTP servers are commonly configured such that a client program wishing to send email via the server must authenticate, that is, provide identification credentials in the form of a user name and password. NetMailBot provides the -authlogin and -authpassword parameters, respectively, for use in specifying these credentials.

Using NetMailBot's -debug parameter logs all of the interaction between NetMailBot and the SMTP server to a log file. The details in the log file can point out instances when you need to use NetMailBot's authentication parameters in order to be able to send email with that SMTP server.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • SMTPAuthentication.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot -to to@mailserver.com -from from@mailserver.com -subject "simple send with authentication" -server mail.mailserver.com -authlogin userid -authpassword password -logfile "c:\tmp\log.txt" -debug

Steps

  1. Unzip the SMTPAuthentication.zip file. This will produce a directory called "SMTPAuthentication". Open this directory.
  2. Open Notepad and edit the batch file "SMTPAuthentication.bat". Change the values of the parameters -to, -from, and -server to a test recipient email address of your choosing, your email address, and your mail server. Also provide your username and password for the SMTP server in the -authlogin and -authpassword parameters, respectively.

NOTE: If you don't know your authentication credentials, ask your system administrator or ISP. If you don't have or can't get such credentials for the chosen SMTP server, you probably won't be able to use that SMTP server for sending your mails, or you might be restricted to only sending mails to recipients within the same domain (i.e. if your server is smtp.mycompany.com, you might only be able to send emails to recipients whose email addresses are in the form xxxxx@mycompany.com).

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive an email message. Check the logfile to see if everything went well with the authentication process.


Friendly Addressing

Purpose

This example demonstrates how to use NetMailBot's "Friendly" names parameters to make mails more personable.

SMTP allows the specification of "friendly" names in addition to the "normal" email addresses used. For instance, we usually work with cryptic email addresses such as "jsw34@com.state.pa.us" which aren't very personable. If this example is John Walker's address, we can use NetMailBot's -tofriendly parameter to include e.g. "John Walker" in outgoing mail headers. Then when John gets an email from us, he will see that it was addressed to "John Walker" and not just the more cold and anonymous "jsw34@com.state.pa.us". The same idea applies to -fromfriendly .

A common mistake is to confuse the parameter specifiers for the -to and -from parameters with those for -tofriendly and -fromfriendly . -to and -from only take "normal" email addresses, thus, something like the following will not work:

-from "The Greater Greenville Country Club"

-fromfriendly and -tofriendly allow use of such names, and each can only be used together with its "normal address counterpart" - they do not replace the use of normal email addresses.

Thus, instead of the above example, we should use something like:

-from newsletter@ggcc.org -fromfriendly "The Greater Greenville Country Club"

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • FriendlyAddressing.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -tofriendly "ExclamationSoft Test Account" -from test@test.com -fromfriendly "Test-o-matic Corp." -server smtp.yourcompany.com -body "Friendly Test!"

Steps

  1. Unzip the FriendlyAddressing.zip file. This will produce a directory called "FriendlyAddressing". Open this directory.
  2. Open Notepad and edit the batch file "FriendlyAddressing.bat". Change the values of the parameters -to, -tofriendly, -from, -fromfriendly, and -server to appropriate values of your choosing and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and, upon finishing, the email addresse specified with the -to parameter should receive an email message with the specified "friendly" names in the header.


Using To, Cc, and Bcc Lists Together

Purpose

This example demonstrates how NetMailBot addresses emails when using To, Cc, and Bcc addressees together. Here we use list files and the -tolist , -cclist , and -bcclist parameters. We discuss the results when -recipientlimit is set to 1 and otherwise.

The -tolist , -cclist , and -bcclist parameters are used only with flat text files that contain email addresses and no other information (i.e. they are not a text file version of "database" connectivity).

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains four files:

  • CombinedAddresseeTypes.bat - The batch file that will instruct NetMailBot to send the email message.
  • tolist.txt - a list of email addresses to be addressed as "To:" recipients with -tolist
  • cclist.txt - a list of email addresses to be addressed as "Cc:" recipients with -cclist
  • bcclist.txt - a list of email addresses to be addressed as "Bcc:" recipients with -bcclist

File Contents

This is the content of the batch file:

NetMailBot -to test@test.com -tolist "tolist.txt" -cclist "cclist.txt" -bcclist "bcclist.txt" -from test@test.com -server smtp.test.com -recipientlimit 1

This is the content of the tolist.txt file:

to1@test.com,to2@test.com,to3@test.com

This is the content of the cclist.txt file:

cc1@test.com,cc2@test.com,cc3@test.com

This is the content of the bcclist.txt file:

bcc1@test.com,bcc2@test.com,bcc3@test.com

Steps

  1. Unzip the CombinedAddresseeTypes.zip file. This will produce a directory called "CombinedAddresseeTypes". Open this directory.
  2. Open Notepad and edit the batch file "CombinedAddresseeTypes.bat". Change the values of the parameters -to , -from , and -server to your email address and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. With -recipientlimit set to 1 as in the batch file above, NetMailbot should start up and produce output similar to the following:

Connecting to smtp.test.com

Preparing message

Adding TO(1): to1@test.com

Adding CC(2): cc1@test.com

Adding BCC(3): bcc1@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(4): to2@test.com

Adding CC(5): cc2@test.com

Adding BCC(6): bcc2@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(7): to3@test.com

Adding CC(8): cc3@test.com

Adding BCC(9): bcc3@test.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 9 recipients

In this case, there were three email messages sent, each with one "To:" recipient, one "Cc:" recipient, and one "Bcc:" recipient.

If, however, you change the batch file so that -recipientlimit is not set to 1 (or omit it entirely, in which case it defaults to 100) the results will now appear as:

Connecting to smtp.test.com

Preparing message

Adding TO(1): to1@test.com

Adding TO(2): to2@test.com

Adding TO(3): to3@test.com

Adding CC(4): cc1@test.com

Adding CC(5): cc2@test.com

Adding CC(6): cc3@test.com

Adding BCC(7): bcc1@test.com

Adding BCC(8): bcc2@test.com

Adding BCC(9): bcc3@test.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 9 recipients

So this time we only sent one email message with three recipients each for the "To:", "Cc:", and "Bcc:" header addressing fields.

Note that -recipientlimit 1 used in the first example applies to each type of addressee ("To:", "Cc:", and "Bcc:") independently: there is only one recipient of each type per email. In the second example all three of each type of addressee are added to the one email sent. We didn't get anywhere near the default limit of 100 recipients. If we had exceeded this default limit, then another email message would have been sent to the "remainder" recipients.


HTML Email

NetMailBot can send emails with message bodies that are either plain text (as exemplified in the previous section) or HTML.

Here we cover two variations on HTML message bodies: those that are from a website and those that are stored on your local hard drive.


HTML Email with Embedded Images from Your Hard Drive

Purpose

This example demonstrates how to send a HTML email with embedded images stored on your local hard drive.

Additional Prerequisites

Using this feature requires working knowledge of creating and editing HTML pages. We have provided an example page here.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains three files:

  • HTMLEmbedLocalDrive.html - The HTML page that will be the email message body.
  • exclamationsoft_logo.gif - The image that will be embedded in the email message.
  • HTMLEmbedLocalDrive.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Customer Follow-Up" -server localhost -logfile c:\tmp\log.txt -bodyfile "c:\tmp\HTMLEmbedLocalDrive\HTMLEmbedLocalDrive.html" -altbody "To view the contents of this email, please visit our website, at http://www.mysite.com" -embed

Steps

  1. Unzip the HTMLEmbedLocalDrive.zip file. This will produce a directory called "HTMLEmbedLocalDrive". Open this directory.
  2. Refer to HTMLEmbedLocalDrive.html for an example HTML file that shows how to create your HTML page with the images you wish to include in your email.
  3. Save your HTML page and all its images in the same directory. In this example, all of the files should be saved in the C:\tmp\HTMLEmbedLocalDrive" directory, unless you want to edit the -bodyfile parameter to match some other location.
  4. The images should reference the image name and directory name. Open HTMLEmbedLocalDrive.html and note that the image exclamationsoft_logo.gif is referenced as:

<IMG alt="" src="c:\tmp\HTMLEmbedLocalDrive\exclamationsoft_logo.gif">

The images must include full path information, e.g C:\tmp\HTMLEmbedLocalDrive\exclamationsoft_logo.gif.

  5. The use of the -altbody parameter allows a recipient whose email client cannot display HTML to receive this plain text message as an alternative.
  6. Open Notepad and edit the batch file "HTMLEmbedLocalDrive.bat". Change the values of the parameters -to, -from, and -server to a test recipient of your choosing, your email address, and your mail server.
  7. Invoke the batch file.
  8. NetMailbot should start up and, upon finishing, the email addresse specified with the -to parameter should receive an HTML email message with the ExclamationSoft logo embedded in it.


HTML Email with Embedded Images from a Website

Purpose

This example demonstrates how to send a a HTML email with embedded images from a web page on a website.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • HTMLEmbedWebsite.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Test: HTML Email w/ Embedded images from a WebSite" -server localhost -logfile c:\tmp\log.txt -bodyfile "http://www.yahoo.com" -altbody "To view the contents of this email, please visit our website, at http://www.mysite.com" -embed

Steps

  1. Unzip the HTMLEmbedWebsite.zip file. This will produce a directory called "HTMLEmbedWebsite". Open this directory.
  2. The use of the -altbody parameter allows a recipient whose email client cannot display HTML to receive this plain text message as an alternative.
  3. Open Notepad and edit the batch file "HTMLEmbedWebsite.bat". Change the values of the parameters -to, -from, and -server to a test recipient of your choosing, your email address, and your mail server.
  4. Invoke the batch file.
  5. NetMailbot should start up and, upon finishing, the email addresse specified with the -to parameter should receive an email message with the specified website embedded.


Attachments

The basics of sending emails containing attachments from a directory you specify are covered here. We also introduce NetMailBot's built-in ability to send attachments from the specified directory as ZIP-compressed files.


How to Send a Single Attachment

Purpose

This example demonstrates how to send a single attachment.

NOTE: You should change the email addresses in the downloadable batch file to your own email address(es) before running a test. Using your own email addresses is the easiest test case.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • SingleAttachment.bat - The batch file that will instruct NetMailBot to send the email message.
  • attach1.txt - An empty text file to attach.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost -attachment "attach1.txt"

Steps

  1. Unzip the SingleAttachment.zip file. This will produce a directory called "SingleAttachment". Open this directory.
  2. Open Notepad and edit the batch file "SingleAttachment.bat". Note these important parameters used in the batch file:

  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -attachment "attach1.txt" instructs NetMailBot to atttach the file "attach1.txt".

NOTE: You must use quotation marks around the filename specified in the -attachment parameter, as shown above.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Check your email account Inbox for an email containing a single attachment named "attach1.txt".


How to Send Two Attachments

Purpose

This example demonstrates how to send an email with two attachments.

NOTE: You should change the email addresses in the downloadable batch file to your own email address(es) before running a test. Using your own email addresses is the easiest test case.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains three files:

  • TwoAttachments.bat - The batch file that will instruct NetMailBot to send the email message.
  • attach1.txt - An empty text file to attach.
  • attach2.txt - An empty text file to attach.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -logfile "c:\tmp\log.txt" -server localhost -attachment "attach1.txt" "attach2.txt"

Steps

  1. Unzip the TwoAttachments.zip file. This will produce a directory called "TwoAttachments". Open this directory.
  2. Open Notepad and edit the batch file "TwoAttachments.bat". Note these important parameters used in the batch file:

  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -attachment "attach1.txt" "attach2.txt" instructs NetMailBot to atttach the files "attach1.txt" and "attach2.txt".

NOTE: You must use quotation marks around the filenames specified in the -attachment parameter, as shown above, and the list is separated by spaces.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Check your email account Inbox for an email containing two attachments named "attach1.txt" and "attach2.txt".


Attach and ZIP Compress .txt Files from a Directory

Purpose

This example demonstrates how to use the parameters -attachmentdir , -zip , and -filemask . The -attachmentdir parameter specifies a directory from which to retrieve files to attach. The -zip parameter instructs NetMailBot to compress all of the files into a single attachment, optionally with a specific name that you specify. The -filemask parameter instructs NetMailBot to only work with the files that match the given file mask.

NOTE: You should change the email addresses in the downloadable batch file to your own email address(es) before running a test.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

Check this paragraph: The -attachmentdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -attachmentdir parameter to reflect wherever you unzip the archive.

The archive contains four files:

  • attach1.txt - A text file to attach.
  • attach2.log - A log file that should not be attached.
  • attach3.txt - Another text file to attach.
  • AttachAndZIPFromDir.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -server localhost -attachmentdir "c:\tmp" -zip -filemask "*.txt"

Steps

  1. Unzip the AttachAndZIPFromDir.zip file. This will produce a directory called "AttachAndZIPFromDir". Open this directory.
  2. Open Notepad and edit the batch file "AttachAndZIPFromDir.bat". Note these important parameters used in the batch file:

  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -attachmentdir "c:\tmp" specifies a directory from which to retrieve files.
  • The parameter -filemask "*.txt" instructs NetMailBot to only watch for files ending with ".txt" the files in the directory "c:\tmp". Only those files will be sent as attachments.
  • The parameter -zip instructs NetMailBot to compress the chosen attachment files into a single ZIP archive. We have not specified a name here, so by default the attachment name will be "attachment.zip".

NOTE: If you do specify a custom filename for your attachment, e.g. -zip "myatt.zip", make sure not to forget to specify the .zip extension, that is, don't specify a name like -zip "myatt". If you do forget, some mail clients might receive the attachment as e.g. "myatt.dat", and will most likely prevent the recipient from being able to open the attachment for security reasons. ".zip" is likely to be a trusted file type, so your recipients should be able to open the attachment.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Check your email account for an email containing a single attachment named "attachment.zip".


Importing ODBC Address Data

In addition to the ability to specify email recipients' addresses directly in the command line (e.g. -to ) or via text files (e.g. -tolist ), NetMailBot can interface with a database via an ODBC connection and take the email addresses from there.

This makes it easy to use data you might already have on hand in your emails.


Introduction: Email Addresses via ODBC

Database Access Parameters

NetMailBot has a number of parameters which make it easy to connect to an ODBC compliant database containing the email addresses to which you want to send email (click on each to go to its page in the Parameters section):

  • -dsn - specifies the Data Source Name (DSN) for the database from which you wish to import email addresses
  • -dbtable - specifies the database table containing the email addresses
  • -dbemailcolumn - specifies the column, in the table specified by -dbtable, that contains the email addresses
  • -dbuseaddressee - specifies which addressing field - "To:", "CC:", or "BCC:" - should be used when applying the email addresses from the database

Steps Involved in Using Database Access Parameters

  1. Set up an ODBC DSN
  2. Create your batch file
  3. Add the required parameters ( -to , -from , -server ) and, optionally, -subject
  4. Add the database access parameters above

See the examples following this introduction.


Mass Mailings

This section introduces how to send mass mails with NetMailBot, starting with an introduction covering the basics of how mass mails work and some options you have concerning addressing and the number of recipients addressed in each email.

We also introduce how to use email addresses stored in a Microsoft Excel spreadsheet.


Introduction: Mass Mailings Strategies

Mass Mailing Concepts

Mass mails are used for various purposes such as marketing campaigns, opt-in newsletters, field advisories (alerts to end users, support staff, sales people, etc. regarding changes to a product or newly discovered problems), and any other case in which an email message must be sent to a large number of recipients in a batch.

NetMailBot allows you to retrieve your mailing list from a database by way of a DSN connection to the database. Using various NetMailBot parameters discussed here , you can quickly send an email to many recipients.

In performing mass mailings, you have options to control both the number of recipients per email using -recipientliimit and how the email addresses retrieved from the database are addressesed - "To:", "Cc:", or "Bcc:" - using -dbuseaddresee . What you choose for -dbuseaddresee has an effect on how NetMailBot handles the limits specified with -recipientliimit , as described below.

NOTE: It is possible to implement a mass mailing without the use of a database; we have included, as a reminder of this, another example in this section which uses a simple text file list of "Bcc:" recipients instead of the database connectivity features.

NOTE: This section does not discuss the mail merge functionality of NetMailBot, which takes the mass mailing functionality discussed here a step further by personalizing the email for each recipient in the database. For such features, see the Mail Merges section.

Options for Controlling the Number of Recipients: -recipientlimit

A mass mailing can be "batch sent" in a few different ways. Suppose you have a database of 1000 email addresses. One strategy would be to send ten emails, each to 100 recipients. Another is to send 100 emails, each to ten recipients. Or, you could send 1000 emails, each to one recipient. Due to the fact that many SMTP servers limit the number of email addresses in the "To:" field to 100, it is unlikely that you could send one email to all 1000 recipients.

You can control the maximum number of recipients per individual email using -recipientlimit . A very common application of this parameter is when you want each recipient to receive an individually-addressed email (the third case listed above: 1000 emails, each to one recipient). If you omit -recipientlimit , NetMailBot's default limit on the number of recipients per email is 100, due to the fact that many SMTP servers tend to be configured with this as the limit anyway.

Options for Controlling How the Emails are Addressed: -dbuseaddressee

The database email addresses could be addressed as "To:", "Cc:", or "Bcc:" recipients - that is, the emails could be sent either directly to the recipients ("To:"), sent as Carbon Copies ("Cc:" - known "parallel" recipients to the "To:" recipient), or as Blind Carbon Copies ("Bcc:" - unknown "parallel" recipients to the "To:" recipient).

Here are some imagined example scenarios for these different types of addressing:

  • To: MaryAnne, the VP of a particular sales division, uses company email addresses stored in a database to send an email to all of her 3rd party distributors concerning an upcoming Distributors Meeting. Using -dbuseaddressee "to", each recipient whose address is in the database receives an email "From:" MaryAnne and "To:" themselves and everyone else in the list (up to 100 emails in the "To:" field per sent email). Although -dbuseaddressee "to" adds email addresses to the "To:" field, the -to parameter is still required. To satisfy this, MaryAnne lists herself as the "To:" recipient.
  • Cc: Bob, a District Manager under MaryAnne, knows that a particular topic at the Distributors Meeting will touch on work done by one of his direct reports, Jill, a Field Representative, and the distributors she routinely visits. He wants to discuss some aspects of the subject before the meeting. He sends an email "To:" Jill and retrieves the distributors' email addresses from the database (we assume it has a structure mirroring the sales territories, which allows him to automatically cull the correct addresses) and uses -dbuseaddressee "cc" to Carbon Copy ("Cc:") all of the distributors.
  • Bcc: Jill has some special arrangements with several of the distributors in her area, but does not want each to know who the others are. She needs to send an update on these arrangements to reflect changes in the local market, so she uses -dbuseaddressee "bcc" to send an appropriate email to the entire list of affected distributors at once, without each knowing the other recipients of the email.

You can control this addressing with the -dbuseaddressee parameter. This is in addition to the recipient you specify with the required parameter -to:

  • -dbuseaddressee "to" adds each database email address to the "To:" field (the first address in the "To:" field comes from the -to parameter) up to the limit set manually by -recipientlimit or the default value of 100, which matches the maximum set by many SMTP servers.
  • -dbuseaddressee "cc" puts the database email addresses into the "Cc:" field.
  • -dbuseaddressee "bcc" puts the database email addresses into the "Bcc:" field.

-dbuseaddresee's Effect on -recipientlimit Count

How you have set -dbuseaddressee affects how NetMailBot handles addressing field limits. When using -dbuseaddressee "to", the address specified in the -to parameter is the first address put in the "To:" field, then the addresses from the database follow, up to the number of addresses specified with -recipientlimit , if specified (if not, the limit is 100, the default). Thus, there is one overall set of "To:" recipients, and the address specified with -to appears only in the first email.

If you use -dbuseaddressee "cc" or -dbuseaddressee "bcc", the address specified in the -to parameter is the addressee used in the "To:" field for each email, but it does not count toward any limit set with -recipientlimit . Instead, -recipientlimit only counts toward the addresses put into the "Cc:" or "Bcc:" field, that is, those from the database.

For example, let's assume you had 300 addresses in your database (for simplicity, let's say "001@xyz.com", "002@xyz.com", etc.) and your -to recipient was "joe@xyz.com". Using -dbu "to" and without specifying -recipientlimit , NetMailBot would send four emails to a total of 301 recipients. The output would look like:

Preparing message

Adding TO(1): joe@xyz.com

Adding TO(2): 001@xyz.com

Adding TO(3): 002@xyz.com

...

Adding TO(100):099@xyz.com

Sending message

Sent to mail server

Preparing message

Adding TO(101): 100@xyz.com

Adding TO(102): 101@xyz.com

Adding TO(103): 102@xyz.com

...

Adding TO(200):199@xyz.com

Sending message

Sent to mail server

Preparing message

Adding TO(201): 200@xyz.com

Adding TO(202): 201@xyz.com

Adding TO(203): 202@xyz.com

...

Adding TO(300):299@xyz.com

Sending message

Sent to mail server

Preparing message

Adding TO(301): 300@xyz.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 301 recipients

If, instead, you used -dbu "cc", the output would look like:

Preparing message

Adding TO(1): joe@xyz.com

Adding CC(2): 001@xyz.com

Adding CC(3): 002@xyz.com

Adding CC(4): 003@xyz.com

...

Adding CC(101): 100@xyz.com

Sending message

Sent to mail server

Adding TO(102): joe@xyz.com

Adding CC(103): 101@xyz.com

Adding CC(104): 102@xyz.com

Adding CC(105): 103@xyz.com

...

Adding CC(202): 200@xyz.com

Preparing message

Sending message

Sent to mail server

Adding TO(203): joe@xyz.com

Adding CC(204): 201@xyz.com

Adding CC(205): 202@xyz.com

Adding CC(206): 203@xyz.com

...

Adding CC(303): 300@xyz.com

Sending message

Sent to mail server

Mail sent successfully to 303 recipients

Thus, in the latter case, the recipient limit of 100 (by default) only applies to the "Cc:" recipients.


Send Newsletter to List of BCC Recipients

Send Newsletter to List of BCC Recipients from ODBC

Purpose

This example demonstrates how to send a Newsletter email to a list of BCC (Blind Carbon Copy) recipients from a simple text file of "Bcc:" recipeints. While the topic of this overall section is importing email addresses and other data from a database for use with NetMailBot, we wanted to include in this "Mass Mailings" topic an example that implements a mass email campaign without the use of database connectivity.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • BCCNewsletter.bat - The batch file that will instruct NetMailBot to send the email message.
  • bcclist.txt - The list of subscribers stored in a simple text file.
  • Newsletter.txt - The newsletter message body.

Batch File Contents

This is the content of the batch file:

NetMailBot -to test@test.com -from test@test.com -server smtp.test.com -bcclist "bcclist.txt" -subject "Here is your Monthy Newsletter" -bodyfile "Newsletter.txt" -logfile "logfile.txt" -debug

Steps

  1. Unzip the BCCNewsletter.zip file. This will produce a directory called "BCCNewsletter". Open this directory.
  2. Open Notepad and edit the batch file "BCCNewsletter.bat". Note these important parameters used in the batch file:

  • Change the parameters -to and -from to your email address.
  • Change the parameter -server to your own mail server.
  • You can change the dummy addresses in bcclist.txt if you like.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Check your email account Inbox for an email containing the text newsletter body. Note that you cannot tell who the other recipients were due to the use of "Bcc:".


Send Individually Addressed Newsletter

Purpose

This example demonstrates how to send a Newsletter email to a list of "To:" recipients whose email addresses are retrieved from a DSN named "XL2K", which is connected to a Microsoft Excel file. The data source has a table named "customer". The table has a column named "email" which contains each the email addresses. Each email will be personally addressed to each recipient ("To:") by using the -recipientlimit parameter set to 1 in combination with the -dbuseaddressee parameter set to "to".

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • IndividualNewsletter.bat - The batch file that will instruct NetMailBot to send the email message.
  • Book1.xls - The list of subscribers stored in a Microsoft Excel file.
  • Newsletter.txt - The newsletter message body.

Batch File Contents

This is the content of the batch file:

NetMailBot -to test@test.com -from test@test.com -server smtp.test.com -dsn "DSN=XL2K" -dbtable "customer" -dbemailcolumn "email" -dbuseaddressee "to" -recipientlimit 1 -subject "Here is your Monthy Newsletter" -bodyfile "Newsletter.txt" -logfile "logfile.txt" -debug

Steps

  1. Unzip the IndividualNewsletter.zip file. This will produce a directory called "IndividualNewsletter". Open this directory.
  2. Open Notepad and edit the batch file "IndividualNewsletter.bat". Note these important parameters used in the batch file:

  • Change the parameters -to and -from to your email address.
  • Change the parameter -server to your own mail server.
  • You can change the dummy addresses in the .xls file if you like.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Check your email account Inbox for an email containing the text newsletter body. You should be the only recipient listed in the "To:" field. Using -recipientlimit 1 ensures that the mails are individually addressed.


How to Send Email to a List in Excel

Purpose

This example demonstrates how to send email to a list of email addresses contained in a Microsoft Excel spreadsheet.

Additional Prerequisites

Using this feature requires Microsoft Excel, in order to be able to edit the Excel spreadsheet as described below, and the latest ODBC drivers, obtainable at the Microsoft website .

Create an Excel Spreadsheet

  1. Open Microsoft Excel.
  2. In cell A1, enter the text "email"
  3. In cell A2, enter a valid email address (suggestion: your own email address)
  4. In cell A3, enter another valid email address (this can again be your own email address)
  5. Highlight all three of these cells
  6. Select the menu item "Insert->Name->Define" (this may be different for versions before Microsoft Office 2000). A dialog box will appear.
  7. Enter the name of the range, "customer", then click "OK". See this screenshot:

  8. Save the spreadsheet in an easy to find location, such as "C:\tmp" and name the file "example.xls".

Create an ODBC DSN

  1. Create an ODBC DSN for Excel named "example". For instructions on creating an ODBC DSN, click here.

Create a batch file

  1. In the same directory that you saved the Excel spreadsheet, create a batch file named "example.bat". For instructions on creating a batch file, click here .
  2. Cut-and-Paste the following text into your "example.bat" batch file:

"c:\program files\netmailbot\netmailbot.exe" -to "change@me.com" -server "mail.changeme.com" -dsn "DSN=example" -dbtable "customer" -dbemailcolumn "email" -dbuseaddressee "to" -recipientlimit 1 -from "change@me.com" -subject "test" -logfile "logfile.txt" -debug

  3. If necessary, change the path to match your installation of netmailbot.exe. Change the -to, -from, and -server parameters to your own email address and mail server.

NOTE: If you use your own email address in the spreadsheet as described above, your email account should receive three emails - one for the fact that you are listed in the -to parameter and two more for the two email addresses found in the spreadsheet (both being your email address) and the use of -recipientlimit 1.


Mail Merges

Here we take NetMailBot's mass mailing capabilities one step further - not only will we take the list of email addresses from the database, but we can use other data in the database to customize the email sent to each recipient. This forms the basis for truly powerful automated email communications!


Access Database and Simple Body

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot. The database used is an MS Access database (Access 2000 version) which contains some sample data.

NOTE: You should change the email addresses in the Access database to your own email address(es) before running a test.

Additional Prerequisites

Using this feature requires Microsoft Access and working knowledge of creating and editing an MS Access database.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • MailMergeAccessSimple.bat - The batch file that will instruct NetMailBot to send the email message.
  • test.mdb - The Access database that contains the mail merge data.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email" -dbreplacementids "<<first_name>>=first_name,<<last_name>>=last_name" -body "<<first_name>> <<last_name>>" -personalize

Steps

  1. Unzip the MailMergeAccessSimple.zip file. This will produce a directory called "MailMergeAccessSimple". Open this directory.
  2. Open the Access database.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Close the Access database.
  5. Open Notepad and edit the batch file "MailMergeAccessSimple.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb". This is a normal connection string that instructs NetMailBot on how to connect to the Access database. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM Customers" instructs NetMailBot to select all of the columns of data from the Customers table in the Access database.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the column named "email" to address the message to the data contained in that column for the current row.
  • The parameter -body "<<first_name>> <<last_name>>" contains replacementids which are explained next.
  • -dbreplacementids "<<first_name>>=first_name,<<last_name>>=last_name" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<first_name>> with the data contained in the column named "first_name".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive an email message.


Access Database and HTML Body

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot. The database used is an MS Access database (Access 2000 version) which contains some sample data. An HTML file is used as the message body.

NOTE: You should change the email addresses in the Access database to your own email address(es) before running a test.

Additional Prerequisites

Using this feature requires Microsoft Access and working knowledge of creating and editing an MS Access database.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains four files:

  • MailMergeAccessHTML.bat - The batch file that will instruct NetMailBot to send the email message.
  • test.mdb - The Access database that contains the mail merge data.
  • body.html - The HTML page that will be the email message body.
  • log.txt - A log file of the invocation of MailMergeAccessHTML.bat for studying

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email" -dbreplacementids "$first_name$=first_name,$last_name$=last_name" -bodyfile "c:\tmp\body.html" -personalize

Steps

  1. Unzip the MailMergeAccessHTML.zip file. This will produce a directory called "MailMergeAccessHTML". Open this directory.
  2. Open the Access database.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Close the Access database.
  5. Open Notepad and edit the batch file "MailMergeAccessHTML.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb". This is a normal connection string that instructs NetMailBot on how to connect to the Access database. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM Customers" instructs NetMailBot to select all of the columns of data from the Customers table in the Access database.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the column named "email" to address the message to the data contained in that column for the current row.
  • The parameter -bodyfile "c:\tmp\body.html" instructs NetMailBot to use body.html as the email message body. If you have not unzipped the archive to C:\tmp, then edit this path accordingly.
  • -dbreplacementids "$first_name$=first_name,$last_name$=last_name" instructs NetMailBot to replace the strings in dollar signs with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string $first_name$ with the data contained in the column named "first_name".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive an HTML email message.
  8. Have a look at the log.txt file included in the archive to see how a NetMailBot session of this type proceeds.


CSV (Text) File and Simple Body File

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot. The database used is a text file in CSV format (comma delimited file) which contains some sample data.

NOTE: You should change the email addresses in the CSV text file to your own email address(es) before running a test.

Additional Prerequisites

Windows 95 / 98 Users: Make sure you have the latest ODBC drivers installed on your machine.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the parameters to reflect wherever you unzip the archive.

The archive contains three files:

  • MailMergeCSVTextBody.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - The CSV file that contains the mail merge data.
  • body.txt - The text file that will be the email message body.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "email" -dbreplacementids

"<<name>>=name,<<tracking>>=tracking" -bodyfile "C:\tmp\body.txt" -personalize

The data.txt file contains:

email,name,tracking

test@exclamationsoft.com,John Smith,Z9102009591871047220382

test@exclamationsoft.com,Mike White,Z9823948208740987409832

test@exclamationsoft.com,Tom Blue,Z2398409577583757873481

The body.txt file contains:

Dear <<name>>,

Your tracking number is <<tracking>>.

Steps

  1. Unzip the MailMergeCSVTextBody.zip file. This will produce a directory called "MailMergeCSVTextBody". Open this directory.
  2. Open the data.txt file.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Save and close the data.txt file.
  5. Open Notepad and edit the batch file "MailMergeCSVTextBody.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;". This is a normal connection string that instructs NetMailBot on how to connect to the data.txt file. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM data.txt" instructs NetMailBot to select all of the data from the file data.txt. This file is considered to be a pseudo database table.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the "column" named "email" to address the message to the data contained in that column for the current row.
  • The parameter -bodyfile "c:\tmp\body.txt" instructs NetMailBot to use body.txt as the email message body. If you have not unzipped the archive to C:\tmp, then edit this path accordingly. In the body.txt file, you will see:

Dear <<name>>,

Your tracking number is <<tracking>>.

The items in double-angle brackets ("<<" and ">>") are "replacement IDs" which are explained next.

  • -dbreplacementids "<<name>>=name,<<tracking>>=tracking" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<name>> with the data contained in the column named "name".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive a personalized text message.


CSV (Text) File with "Friendly Names"

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot, specifically how to set the friendly name of the recipient. The database used is a text file in CSV format (comma delimited file) which contains some sample data.

NOTE: You should change the email addresses in the CSV text file to your own email address(es) before running a test.

Additional Prerequisites

Windows 95 / 98 Users: Make sure you have the latest ODBC drivers installed on your machine.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the parameters to reflect wherever you unzip the archive.

The archive contains three files:

  • MailMergeCSVFriendly.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - The CSV file that contains the mail merge data.
  • body.txt - The text file that will be the email message body.

File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "email" -dbreplacementids "<<firstName>>=firstName,<<lastName>>=lastName,<<tracking>>=tracking" -bodyfile "body.txt" -personalize -tofriendly "<<firstName>> <<lastName>>" -test -debug

The data file contains:

email,firstName,lastName,tracking

test@exclamationsoft.com,John,Smith,Z9102009591871047220382

test@exclamationsoft.com,Mike,White,Z9823948208740987409832

test@exclamationsoft.com,Tom,Blue,Z2398409577583757873481

Here is the body.txt file:

Dear <<firstName>> <<lastName>>,

Your tracking number is <<tracking>>

Steps

  1. Unzip the MailMergeCSVFriendly.zip file. This will produce a directory called "MailMergeCSVFriendly". Open this directory.
  2. Open the data.txt file.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Save and close the data.txt file.
  5. Open Notepad and edit the batch file "MailMergeCSVFriendly.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;". This is a normal connection string that instructs NetMailBot on how to connect to the data.txt file. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM data.txt" instructs NetMailBot to select all of the data from the file data.txt. This file is considered to be a pseudo database table.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the "column" named "email" to address the message to the data contained in that column for the current row.
  • The parameter -bodyfile "body.txt" instructs NetMailBot to use body.txt as the email message body. This time we have used a relative path; that is, NetMailBot will look for a file "body.txt" in the same directory as the batch file. Previous examples used a full path as in "C:\tmp\body.txt". In the body.txt file, you will see:

Dear <<firstName>> <<lastName>>,

Your tracking number is <<tracking>>.

The items in double-angle brackets ("<<" and ">>") are "replacement IDs" which are explained next.

  • -dbreplacementids "<<firstName>>=firstName,<<lastName>>=lastName,<<tracking>>=tracking" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<firstName>> with the data contained in the column named "firstName".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  • -tofriendly "<<firstName>> <<lastName>>" instructs NetMailBot to append a friendly name to the "To:" addressing field using the replacement IDs listed.
  • -test instructs NetMailBot to only perform a test of these operations; no actual emails will be sent.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive a personalized text message. The "To:" field should include a "friendly" name (e.g. "John Smith") as well as the usual "unfriendly" email address (e.g. "jsmith12@somecompany.com").


CSV (Text) File with Custom Body Text

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot, specifically how to personalize the fields: to, from, subject, and message body. The premise is reporting of contest results. The database used is a text file in CSV format (comma delimited file) which contains some sample data.

NOTE: You should change the email addresses in the CSV text file to your own email address(es) before running a test.

Additional Prerequisites

Windows 95 / 98 Users: Make sure you have the latest ODBC drivers installed on your machine.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the parameters to reflect wherever you unzip the archive.

The archive contains three files:

  • MailMergeCSVCustomText.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - The CSV file that contains the mail merge data.
  • body.txt - The message body.

File Contents

This is the content of the batch file:

netmailbot -to ignored -from "<<from>>" -subject "<<subject>>" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "to" -dbreplacementids "<<name>>=name,<<from>>=from,<<to>>=to,<<subject>>=subject" -bodyfile "c:\tmp\body.txt" -personalize -debug

The data file contains:

to,from,name,subject

test@exclamationsoft.com,one@exclamationsoft.com,John Smith,You win

test@exclamationsoft.com,two@exclamationsoft.com,Mike White,You lose

test@exclamationsoft.com,three@exclamationsoft.com,Tom Blue,Tie game

Here is the body.txt file:

Dear <<name>>,

This email is from <<from>>

This email is to <<to>>

The outcome of the game is: <<subject>>

Steps

  1. Unzip the MailMergeCSVCustomText.zip file. This will produce a directory called "MailMergeCSVCustomText". Open this directory.
  2. Open the data.txt file.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Save and close the data.txt file.
  5. Open Notepad and edit the batch file "MailMergeCSVCustomText.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;". This is a normal connection string that instructs NetMailBot on how to connect to the data.txt file. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM data.txt" instructs NetMailBot to select all of the data from the file data.txt. This file is considered to be a pseudo database table.
  • -dbemailcolumn "to" instructs NetMailBot to use the data in the "column" named "to" to address the message to the data contained in that column for the current row. This overrides the -to parameter, which is why we've put "ignored" in it.
  • The parameter -bodyfile "C:\tmp\bodyfile.txt" instructs NetMailBot to use the contents of the file body.txt as the email message body.
  • -dbreplacementids "<<name>>=name,<<from>>=from,<<to>>=to,<<subject>>=subject" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<name>> with the data contained in the column named "name", and will replace the string <<from>> with the data contained in the column named "from", and so on.
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified indirectly via the -dbemailcolumn parameter should each receive a personalized text message.


CSV (Text) File, Custom Body Text and Bodyfile

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot, specifically how to personalize the fields "To:", "From:", "Subject:", and the filename of the email message body. The scenario used here is reporting the results of a contest or sweepstakes to winners, losers, and those who have won a tie game. The message body is loaded from a file that is dynamically assigned based on win/lose/tie data in the .csv file (the database used is a text file in CSV format which contains some sample data).

NOTE: You should change the email addresses in the CSV text file to your own email address(es) before running a test.

Additional Prerequisites

Windows 95 / 98 Users: Make sure you have the latest ODBC drivers installed on your machine.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the parameters to reflect wherever you unzip the archive.

The archive contains five files:

  • MailMergeCSVCustomBody.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - The CSV file that contains the mail merge data.
  • winner.txt - A text file that is a message body.
  • loser.txt - A text file that is a message body
  • tied.txt - A text file that is a message body

File Contents

This is the content of the batch file:

netmailbot -to ignored -from "<<from>>" -subject "<<subject>>" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "to" -dbreplacementids "<<name>>=name,<<from>>=from,<<to>>=to,<<subject>>=subject,<<filename>>=filename" -bodyfile "c:\tmp\<<filename>>" -personalize -debug

The data file contains:

to,from,name,subject,filename

test@exclamationsoft.com,one@exclamationsoft.com,John Smith,You win,winner.txt

test@exclamationsoft.com,two@exclamationsoft.com,Mike White,You lose,loser.txt

test@exclamationsoft.com,three@exclamationsoft.com,Tom Blue,Tie game,tied.txt

Here is the winner.txt file, to illustrate the custom mail bodies used in this example:

Dear <<name>>,

This email is from <<from>>

This email is to <<to>>

The outcome of the game is: <<subject>>

Please pickup your prize!

Steps

  1. Unzip the MailMergeCSVCustomBody.zip file. This will produce a directory called "MailMergeCSVCustomBody". Open this directory.
  2. Open the data.txt file.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Save and close the data.txt file.
  5. Open Notepad and edit the batch file "MailMergeCSVCustomBody.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;". This is a normal connection string that instructs NetMailBot on how to connect to the data.txt file. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM data.txt" instructs NetMailBot to select all of the data from the file data.txt. This file is considered to be a pseudo database table.
  • -dbemailcolumn "to" instructs NetMailBot to use the data in the "column" named "to" to address the message to the data contained in that column for the current row. This overrides the -to parameter, which is why we've put "ignored" in it.
  • The parameter -bodyfile "C:\tmp\<<filename>>" instructs NetMailBot to replace <<filename>> with the data contained in the mapped column for the current row. In this example, each recipient will have a different message body. The first recipient will have the message body from the file "winner.txt", the second will have "loser.txt", and the third will have "tied.txt".
  • -dbreplacementids "<<name>>=name,<<from>>=from,<<to>>=to,<<subject>>=subject,<<filename>>=filename" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<name>> with the data contained in the column named "name", and will replace the string <<from>> with the data contained in the column named "from", and so on.
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified indirectly via the -dbemailcolumn parameter should each receive a personalized text message.


CSV (Text) File with Custom Attachment

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot. Specifically, it demonstrates how one can set the -attachment parameter to a field in a database/data file. The database used is a text file in CSV format (comma delimited file) which contains some sample data.

NOTE: You should change the email addresses in the CSV text file to your own email address(es) before running a test.

Additional Prerequisites

Windows 95 / 98 Users: Make sure you have the latest ODBC drivers installed on your machine.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the parameters to reflect wherever you unzip the archive.

The archive contains four files:

  • MailMergeCSVCustAtch.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - The CSV file that contains the mail merge data.
  • body.txt - The message body.
  • stuff.txt - A file that is used as an attachment.

File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "email" -dbreplacementids "<<name>>=name,<<tracking>>=tracking,<<attachment>>=attachment" -bodyfile "c:\tmp\body.txt" -attachment "<<attachment>>" -personalize

The data file contains:

email,name,tracking,attachment

test@exclamationsoft.com,John Smith,Z9102009591871047220382,c:\tmp\body.txt

test@exclamationsoft.com,Mike White,Z9823948208740987409832,c:\tmp\stuff.txt

test@exclamationsoft.com,Tom Blue,Z2398409577583757873481,c:\tmp\body.txt

Here is the body.txt file:

Dear <<name>>,

Your tracking number is <<tracking>>

The stuff.txt file is empty.

Steps

  1. Unzip the MailMergeCSVCustAtch.zip file. This will produce a directory called "MailMergeCSVCustAtch". Open this directory.
  2. Open the data.txt file.
  3. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  4. Save and close the data.txt file.
  5. Open Notepad and edit the batch file "MailMergeCSVCustAtch.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tmp\;Extended properties=Text;". This is a normal connection string that instructs NetMailBot on how to connect to the data.txt file. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT * FROM data.txt" instructs NetMailBot to select all of the data from the file data.txt. This file is considered to be a pseudo database table.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the "column" named "email" to address the message to the data contained in that column for the current row. This overrides the -to parameter.
  • The parameter -bodyfile "C:\tmp\bodyfile.txt" instructs NetMailBot to use the contents of the file body.txt as the email message body. The replacement IDs in the body are replaced as described next.
  • -dbreplacementids "<<name>>=name,<<tracking>>=tracking,<<attachment>>=attachment" instructs NetMailBot to replace the strings in double-angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<name>> with the data contained in the column named "name".
  • -attachment "<<attachment>>" instructs NetMailBot to attach a file based on the data contained in the column mapped to <<attachment>>, which happens to be "attachment".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  6. Invoke the batch file by double-clicking the icon or straight from the command line.
  7. NetMailbot should start up and, upon finishing, the email addresses specified indirectly via the -dbemailcolumn parameter should each receive a personalized text message with attachments dynamically added based on the data in the data file.


Access Database Using Two Tables

Purpose

This example demonstrates how to send an email using the mail merge features in NetMailBot, while using two database tables. The notable aspect of this example is that -dbquery uses a SQL Join to query data from two tables to be used in the mail merge. The database used is an MS Access database (Access 2000 version) which contains some sample data.

NOTE: You should change the email addresses in the Access database to your own email address(es) before running a test.

Additional Prerequisites

Using this feature requires Microsoft Access and working knowledge of creating and editing an MS Access database. Also required is understanding of basic SQL concepts including multi-table joins.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains two files:

  • MailMergeAccess2Tbls.bat - The batch file that will instruct NetMailBot to send the email message.
  • test.mdb - The Access database that contains the mail merge data.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Mail Merge Example" -server localhost -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb" -dbquery "SELECT Customers.first_name, Customers.last_name, Email.email FROM Customers, Email WHERE Customers.ID = Email.customer_id" -dbemailcolumn "email" -dbreplacementids "<<first_name>>=first_name,<<last_name>>=last_name" -body "<<first_name>> <<last_name>>" -personalize

Steps

  1. Unzip the MailMergeAccess2Tbls.zip file. This will produce a directory called "MailMergeAccess2Tbls". Open this directory.
  2. Open the Access database.
  3. Open the table Email for editing.
  4. Change all of the email addresses to your email address (for the purposes of this test run, they can all be the same).
  5. Close the Access database.
  6. Open Notepad and edit the batch file "MailMergeAccess2Tbls.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • Note the use of -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\tmp\test.mdb". This is a normal connection string that instructs NetMailBot on how to connect to the Access database. If you have not unzipped the archive to C:\tmp, you will have to edit this accordingly.
  • -dbquery "SELECT Customers.first_name, Customers.last_name, Email.email FROM Customers, Email WHERE Customers.ID = Email.customer_id" instructs NetMailBot to select all of the columns of data from the Customers and Email tables in the Access database. The columns first_name and last_name are from the Customers table, and the column email is from the Email table.
  • -dbemailcolumn "email" instructs NetMailBot to use the data in the column named "email" to address the message to the data contained in that column for the current row.
  • The parameter -body "<<first_name>><<last_name>>" contains replacementids which are explained next.
  • -dbreplacementids "<<first_name>>=first_name,<<last_name>>=last_name" instructs NetMailBot to replace the strings in double angle brackets with the data contained in the mapped column for the current row. For example, in the message body, NetMailBot will replace the string <<first_name>> with the data contained in the column named "first_name".
  • -personalize instructs NetMailBot to make the replacements. Without this parameter specified, NetMailBot will not perform any replacements.
  7. Invoke the batch file by double-clicking the icon or straight from the command line.
  8. The email recipients retrieved in the query should each receive an email with their name in the message body.


Different Delimiters for Replacement IDs

Sometimes you may find that you need to delimit Replacement IDs differently depending on the format of the medium into which they are being substituted. We introduce such scenarios then give an example applicable to HTML message bodies.


Introduction: When to Use Different Delimiters

Delimiters and Syntactic Interference

The -dbreplacementids parameter specifies the replacement identifiers to be used with -personalize . The format of the parameter's specifiers is:

-dbreplacementids "<delimiter><first id name><delimiter>=<first column name>, <delimiter><second id name><delimiter>=<second column name> [...]"

The most common example delimiters used are << and >>, thus you will see lots of examples in .bat files like:

-dbreplacementids "<<date>>=date,<<name>>=name"

Sometimes the chosen delimiters can cause problems, mainly because they have another meaning in the "medium" into which they are being expanded. Fortunately, NetMailBot allows you to use any delimiters you like.

<< and >> and HTML Message Body Problems

The most common known conflict is use of << and >> as delimiters when the replacement IDs are in HTML message bodies, because HTML uses < and > as tag delimiters. In this case, try any other alternative, such as $ or @, in your .bat file:

-dbreplacementids "$firstname$=first_name,$lastname$=last_name"

...and in your HTML body file:

<p>Dear $firstname$ $lastname$</p>

You can use any delimiting characters you like: [[ ]], [ ], $ $, @ @, etc. You can even mix different delimiters within the same replacement ID set, although this is probably unnecessary. For example:

-dbreplacementids "$first_name$=first_name,#last_name#=last_name"

Then in an HTML message body:

<html><body><font face="arial">Dear $first_name$ #last_name#, thank you for contacting us.</font></body></html>

When having problems with replacement ID expansion, consider whether the delimiters you're using might be causing problems in the message body.


Alternative Delimiters in an HTML Message Body

Purpose

This example demonstrates how to use alternative delimiters in an HTML message body.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains three files:

  • AltHTMLDelimiters.bat - The batch file that will instruct NetMailBot to send the email message.
  • data.txt - the data file holding the email addresses and names to send to
  • msg.html - an HTML message body for personalization

File Contents

This is the content of the batch file:

netmailbot -to test@test.com -from test@test.com -server smtp.mycompany.com -logfile c:\tmp\log.txt -dsn "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\AltHTMLDelimiters\;Extended properties=Text;" -dbquery "SELECT * FROM data.txt" -dbemailcolumn "to" -dbreplacementids "$firstname$=firstname,$lastname$=lastname" -bodyfile "msg.html" -personalize -debug

This is the content of the data.txt file:

to,firstname,lastname

joe.blow@test.com,Joe,Blow

suzie.q@test.com,Suzie,Q

bob.smith@test.com,Bob,Smith

This is the content of the msg.html file:

<html>

<body>

<font face="arial">

Dear $firstname$ $lastname$,<br><br>

Here is your monthy newsletter!

</font>

</body>

</html>

Steps

  1. Unzip the AltHTMLDelimiters.zip file. This will produce a directory called "AltHTMLDelimiters". Open this directory.
  2. Open Notepad and edit the batch file "AltHTMLDelimiters.bat". Change the values of the parameters -to, -from, and -server to two test email addresses of your choosing and your mail server. Depending on where you unzip the file, you may have to adjust the DSN string as well (the batch file assumes D:)
  3. Edit the data.txt file to contain at least one legitimate email address to which you have access, so that you can verify the results of the operation.
  4. Invoke the batch file by double-clicking the icon or straight from the command line.
  5. NetMailbot should start up and, upon finishing, the email addresses specified in the data file should each receive a customized email message.


Watch a Directory

NetMailBot can keep an eye on a directory you specify and send you an email whenever a file appears there, including the file as an attachment. You can control what kinds of files NetMailBot will watch out for, and what it will do with the files that appear after it sends them (to whomever you specify) as attachments - either deleting them or moving them to a new directory.


Watch and Delete Files after Sending

Purpose

This example demonstrates how to use the watch directory features of NetMailBot. Specifically, a directory is watched for new files; when new files are found, they are sent to the recipient as an email attachment. After the email is sent, the files in the directory being watched are deleted.

NOTE: You should change the email addresses in the batch file to your own email address(es) before running a test.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -watchdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains one file and a directory containing three more files:

  • WatchSendAndDelete.bat - The batch file that will instruct NetMailBot to send the email message.
  • watch\attach1.txt - a file to attach
  • watch\attach2.txt - a file to attach
  • watch\attach3.txt - a file to attach

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "watch and delete" -server localhost -watchdir "c:\tmp\watch" -watchdelete

Steps

  1. Unzip the WatchSendAndDelete.zip file. This will produce a directory called "WatchSendAndDelete". Open this directory.
  2. Open Notepad and edit the batch file "WatchSendAndDelete.bat". Open Notepad and edit the batch file "MailMergeAccess2Tbls.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -watchdir "c:\tmp\watch" instructs NetMailBot to watch the directory "c:\tmp\watch" for files to send as attachments to the -to email address. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -watchdelete instructs NetMailBot to delete the files in the directory "c:\tmp\watch" after the email is sent. Adjust this if you did not extract the archive to "c:\tmp".
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Go to the directory "c:\tmp\watch" to ensure the files have been deleted.
  5. Check your email account for an email containing the file attachments.


Watch and Move Files after Sending

Purpose

This example demonstrates how to use the watch directory features of NetMailBot. Specifically, a directory is watched for new files, when new files are found, they are sent to the recipient as an email attachment. After the email is sent, the files in the directory being watched are moved to the specified directory.

NOTE: You should change the email addresses in the batch file to your own email address(es) before running a test.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -watchdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains one file and a directory containing three more files:

  • WatchSendAndMove.bat - The batch file that will instruct NetMailBot to send the email message.
  • watch\attach1.txt - a file to attach
  • watch\attach2.txt - a file to attach
  • watch\attach3.txt - a file to attach

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -server localhost -watchdir "c:\tmp\watch" -watchmoveto "c:\tmp"

Steps

  1. Unzip the WatchSendAndMove.zip file. This will produce a directory called "WatchSendAndMove". Open this directory.
  2. Open Notepad and edit the batch file "WatchSendAndMove.bat". Open Notepad and edit the batch file "MailMergeAccess2Tbls.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -watchdir "c:\tmp\watch" instructs NetMailBot to watch the directory "c:\tmp\watch" for files to send as attachments to the -to email address. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -watchmoveto "c:\tmp" instructs NetMailBot to move the files in the directory "c:\tmp\watch" to the directory "c:\tmp" after the email is sent. Adjust this if you did not extract the archive to "c:\tmp".
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Go to the directory "c:\tmp\watch" to ensure the files no longer exist there and check "c:\tmp" to ensure that the files now exist there.
  5. Check your email account for an email containing the file attachments.


Watch, ZIP, and Delete after Sending

Purpose

This example demonstrates how to use the watch directory features of NetMailBot. Specifically, a directory is watched for new files, when new files are found, they ZIP compressed then sent to the recipient as an one email attachment. After the email is sent, the files in the directory being watched are deleted.

NOTE: You should change the email addresses in the batch file to your own email address(es) before running a test.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -watchdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains one file and a directory containing three more files:

  • WatchZIPSendAndDelete.bat - The batch file that will instruct NetMailBot to send the email message.
  • watch\attach1.txt - a file to attach
  • watch\attach2.txt - a file to attach
  • watch\attach3.txt - a file to attach

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -server localhost -watchdir "c:\tmp\watch" -watchdelete -zip

Steps

  1. Unzip the WatchZIPSendAndDelete.zip file. This will produce a directory called "WatchZIPSendAndDelete". Open this directory.
  2. Open Notepad and edit the batch file "WatchZIPSendAndDelete.bat". Open Notepad and edit the batch file "MailMergeAccess2Tbls.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -watchdir "c:\tmp\watch" instructs NetMailBot to watch the directory "c:\tmp\watch" for files to send as attachments to the -to email address. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -watchdelete instructs NetMailBot to delete the files in the directory "c:\tmp\watch" after the email is sent. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -zip instructs NetMailBot to ZIP compress all of the attachments into one ZIP file and send it as the attachment.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Go to the directory "c:\tmp\watch" to ensure the files have been deleted.
  5. Check your email account for an email containing the file attachments.


Watch with Filemask, Delete after Sending

Purpose

This example demonstrates how to use the watch directory features of NetMailBot. Specifically, a directory is watched for new files matching a specified file mask; when new files are found, they are sent to the recipient as an email attachment. After the email is sent, the files in the directory being watched are deleted.

NOTE: You should change the email addresses in the batch file to your own email address(es) before running a test.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The -watchdir parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.

The archive contains one file and a directory containing three more files:

  • WatchFilemaskAndDelete.bat - The batch file that will instruct NetMailBot to send the email message.
  • watch\attach1.txt - a file to attach
  • watch\attach2.txt - a file to attach
  • watch\attach3.txt - a file to attach

Batch File Contents

This is the content of the batch file:

netmailbot.exe -to test@exclamationsoft.com -from test@exclamationsoft.com -server localhost -watchdir "c:\tmp\watch" -watchdelete -filemask "*.txt"

Steps

  1. Unzip the WatchFilemaskAndDelete.zip file. This will produce a directory called "WatchFilemaskAndDelete". Open this directory.
  2. Open Notepad and edit the batch file "WatchFilemaskAndDelete.bat". Open Notepad and edit the batch file "WatchFilemaskAndDelete.bat". Note these important parameters used in the batch file:
  • Change the parameters: -to test@exclamationsoft.com -from test@exclamationsoft.com to your own email address.
  • Change the parameter: -server localhost to your own mail server.
  • The parameter -watchdir "c:\tmp\watch" instructs NetMailBot to watch the directory "c:\tmp\watch" for files to send as attachments to the -to email address. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -watchdelete instructs NetMailBot to delete the files in the directory "c:\tmp\watch" after the email is sent. Adjust this if you did not extract the archive to "c:\tmp".
  • The parameter -filemask "*.txt" instructs NetMailBot to only watch for files ending with ".txt" among the files in "c:\tmp\watch". Only those files will be sent as attachments and deleted after the email is sent.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. Go to the directory "c:\tmp\watch" to ensure the files attach1.txt and attach3.txt have been deleted, but attach2.log has not.
  5. Check your email account for an email containing the file attachments attach1.txt and attach3.txt.


Using NetMailBot from Perl Programs

You might be interested in integrating NetMailBot into other programs you write as part of a larger system in which NetMailBot will handle many automated emailing functions. This section gives examples of different ways to call NetMailBot from within Perl scripts.


Send Email with the Process Command

Purpose

This example Perl program shows how NetMailBot can be invoked from within Perl using Perl's Process command.

Additional Prerequisites

Using this feature requires knowledge of the Perl programming language and a working installation of Perl on your computer.

Prepared Example Files

The code below is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • PerlProcess.pl - The batch file that will instruct NetMailBot to send the email message.

Perl File Contents

This is the content of the Perl file:

#!/usr/bin/perl -w

use strict;

use Win32::Process;

my ($processobj, $exitcode);

my $executable = 'NetMailBot.exe';

my $server = 'mail.domain.com';

my $from = 'to@domain.com';

my $to = 'from@domain.com';

my $subject = 'Test: Perl process Command';

my $body = "Test: Perl process Command";

my $Args = '-server ' . $server .

' -from ' . $from .

' -to ' . $to .

' -subject ' . '"' . $subject . '"' .

' -body ' . '"' . $body . '"';

Win32::Process::Create( $processobj, $executable, $args, 0, CREATE_NEW_CONSOLE, "." );

if ($processobj)

{

print "Process started with PID ", $processobj->GetProcessID(), "\n";

print "Process completed with exit code ", $processobj->GetExitCode( $exitcode ), "\n";

}

else

{

print "Unable to start process: ", Win32::FormatMessage( Win32::GetLastError() ), "\n";

}


Send Email with the Spawn Command

Purpose

This example Perl program shows how NetMailBot can be invoked from within Perl using Perl's Spawn command.

Additional Prerequisites

Using this feature requires knowledge of the Perl programming language and a working installation of Perl on your computer.

Prepared Example Files

The code below is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • PerlSpawn.pl - The batch file that will instruct NetMailBot to send the email message.

Perl File Contents

This is the content of the Perl file:

#!/usr/bin/perl -w

use strict;

my $Pid;

my $executable = 'NetMailBot.exe';

my $server = 'mail.domain.com';

my $from = 'to@domain.com';

my $to = 'from@domain.com';

my $subject = 'Test: Perl Spawn Command';

my $body = "Test: Perl Spawn Command";

my $Args = '-server ' . $server .

' -from ' . $from .

' -to ' . $to .

' -subject ' . '"' . $subject . '"' .

' -body ' . '"' . $body . '"';

Win32::Spawn( $executable, $Args, $Pid );

if ($Pid)

{

print "Process started with PID ", $Pid , "\n";

}

else

{

print "Unable to start process: ", Win32::FormatMessage( Win32::GetLastError() ), "\n";

}


Send Email with a System Call

Purpose

This example Perl program shows how NetMailBot can be invoked from within Perl using a "system" call.

Additional Prerequisites

Using this feature requires knowledge of the Perl programming language and a working installation of Perl on your computer.

Prepared Example Files

The code below is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • PerlSystemCall.pl - The batch file that will instruct NetMailBot to send the email message.

Perl File Contents

This is the content of the Perl file:

#!/usr/bin/perl -w

use strict;

my $executable = 'NetMailBot.exe';

my $server = 'mail.domain.com';

my $from = 'to@domain.com';

my $to = 'from@domain.com';

my $subject = 'Test: Perl system call';

my $body = "Test: Perl system call";

my @args = ( "$executable", "-d", "-S", "$server",

"-from", "$from",

"-to", "$to",

"-server", "\"$subject\"",

"-body", "\"$body\""

);

my $result = system(@args);

print "$result";


Advanced Features and Techniques

Here we introduce a few more advanced features of NetMailBot and techniques that you might find useful in your applications.


DOS Environment Variables in Message Bodies

Purpose

This example demonstrates how to refer to DOS environment variables within message bodies so that the values held in the environment variables can be "expanded" into the message bodies on-the-fly.

This technique could conceivably work anywhere in the NetMailBot batch file, as long as the resulting values after "expansion" make sense within the NetMailBot command line.

NOTE: This also works directly on the command line.

Additional Prerequisites

Using this feature requires familiarity with DOS environment variables.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • EnvVarExpansion.bat - the .batch file that instructs NetMailBot to carry out the desired actions.

Batch File Contents

This is the content of the batch file:

netmailbot -to test@exclamationsoft.com -from test@exclamationsoft.com -subject "Expanding Environment Variables on %date%" -server localhost -logfile c:\tmp\log.txt -body "This message was sent on %date% at %time%."

Steps

  1. Unzip the EnvVarExpansion.zip file. This will produce a directory called "EnvVarExpansion". Open this directory.
  2. Open Notepad and edit the batch file "EnvVarExpansion.bat". Change the values of the parameters -to, -from, and -server to a test recipient of your choosing, your email address, and your mail server.
  3. Invoke the batch file. You will see that the environment variable name substitution occurs first, before the batch file is used to run NetMailBot. The result of this expansion is automatically echoed to the console (only the first line below is typed in; the rest comes back at you just before NetMailBot starts up):

D:\EnvVarExpansion>EnvVarExpansion

D:\EnvVarExpansion>netmailbot -to joe@test.com -from test@exclamationsoft.com -subject "Expanding Environment Variables Demonstration" -server mysmtp

.mycomp.net -logfile c:\tmp\log.txt -body "This message was sent on Sun 07/25/2004 at 15:59:52.32."

  4. NetMailbot should start up and, upon finishing, the email address specified with the -to parameter should receive an email message containing the actual date and time that the message was sent instead of the environment variable names %date% and %time%.


Getting Around SMTP Sending Restrictions

A common problem with communicating with SMTP servers involves restrictions on the number of mails you are allowed to send, either per connection or per time. NetMailBot includes some features to help you work around these limitations so that large batches of outgoing mail, which are typically initiated then expected to complete unattended, do not fail.


Controlling Throughput to the SMTP Server

Purpose

This example demonstrates how to control the rate at which NetMailBot sends data (outgoing mail) to the SMTP server. The parameter used to achieve this is -sendwait .

This is useful when your ISP or SMTP Server Administrator has restricted the rate at which you can send mails with the server. Many SMTP servers can be configured to restrict the number of mails allowed to be sent per connection per some unit of time, for example, ten mails per minute. A symptomatic response from the SMTP server indicating that the sender has exceeded this limit might be "No more transactions allowed." You can log the interactions between NetMailBot and the SMTP server with the -logfile and -debug parameters in order to catch such error messages.

NetMailBot's -sendwait parameter allows you to specify an amount of time that NetMailBot should wait between sending emails. Ask your ISP or SMTP Server Administrator if such a limit exists and what it is. This might help you adjust the delay time you specify with -sendwait without too much trial-and-error.

NOTE: In our example here, we have a mailing list of 15 fake emails. Recall that the default limit on the number of recipients per email is 100; in order to demonstrate the use of -sendwait without having to create a list of several hundred fake email addresses, we are using -recipientlimit to limit the number of recipients per email to three.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • ThrottleSending.bat - The batch file that will instruct NetMailBot to send the email message.
  • tolist.txt - the list of 15 fake email addresses to send to.

File Contents

This is the content of the batch file:

NetMailBot -to test@exclamationsoft.com -body "Send w/ Throttling" -tolist "tolist.txt" -from email@domain.com -server smtp.test.com -subject "Controlling send rate" -sendwait 2000 -recipientlimit 3

This is the content of the tolist.txt file:

001@test.com,002@test.com,003@test.com,004@test.com,005@test.com,006@test.com,007@test.com,008@test.com,009@test.com,010@test.com,011@test.com,012@test.com,013@test.com,014@test.com,015@test.com

Steps

  1. Unzip the ThrottleSending.zip file. This will produce a directory called "ThrottleSending". Open this directory.
  2. Open Notepad and edit the batch file "ThrottleSending.bat". When using -tolist , -to is ignored, so you can leave that unchanged. Change the values of the parameters -from and -server to your email address and your mail server name, respectively.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and you should see output similar to the following. In a more realistic setting with hundreds of recipients, you might omit the use of -recipientlimit , in which case each mail sent would be addressed to 100 recipients (the default recipient limit) but there would still be a two second delay between emails.

NOTE: There may be cases in which your SMTP server imposes both "per-connection" and "mails per unit time" limitations. In such cases, use both -reconnectaftersend and -sendwait to send mass mailiings successfully. See this example for use of -reconnectaftersend .

Connecting to smtp.test.com

Preparing message

Adding TO(1): 001@test.com

Adding TO(2): 002@test.com

Adding TO(3): 003@test.com

Sending message

Sent to mail server

Waiting 2000ms...

Preparing message

Adding TO(4): 004@test.com

Adding TO(5): 005@test.com

Adding TO(6): 006@test.com

Sending message

Sent to mail server

Waiting 2000ms...

Preparing message

Adding TO(7): 007@test.com

Adding TO(8): 008@test.com

Adding TO(9): 009@test.com

Sending message

Sent to mail server

Waiting 2000ms...

Preparing message

Adding TO(10): 010@test.com

Adding TO(11): 011@test.com

Adding TO(12): 012@test.com

Sending message

Sent to mail server

Waiting 2000ms...

Preparing message

Adding TO(13): 013@test.com

Adding TO(14): 014@test.com

Adding TO(15): 015@test.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 15 recipients


Working Around Per-Connection Sending Limits

Purpose

This example demonstrates how to use NetMailBot when you are only permitted to send so many mails per some unit of time.

SMTP servers often can also be configured to limit the number of emails that can be sent per connection. NetMailBot's -reconnectaftersend parameter causes NetMailBot to send only one email per connection. That is, NetMailBot connects to the SMTP server, sends an email, disconnects, connects again, sends another email, disconnects, etc.

While this influences the overall performance, you do not have to worry about hitting per-connection sending limits using -reconnectaftersend .

NOTE: In our example here, we have a mailing list of 15 fake emails. Recall that the default limit on the number of recipients per email is 100; in order to make our demonstration of the use of -reconnectaftersend "interesting" (i.e. with multiple connects and disconnects), we are using -recipientlimit to limit the number of recipients per email to three.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • ReconnectAfterSend.bat - The batch file that will instruct NetMailBot to send the email message.
  • tolist.txt - the list of 15 fake email addresses to send to.

File Contents

This is the content of the batch file:

NetMailBot -to test@exclamationsoft.com -body "Reconnect After Sending" -tolist "tolist.txt" -from test@exclamationsoft.com -server smtp.mycompany.com -subject "Reconnect after send" -reconnectaftersend -recipientlimit 3

This is the content of the tolist.txt file:

001@test.com,002@test.com,003@test.com,004@test.com,005@test.com,006@test.com,007@test.com,008@test.com,009@test.com,010@test.com,011@test.com,012@test.com,013@test.com,014@test.com,015@test.com

Steps

  1. Unzip the ReconnectAfterSend.zip file. This will produce a directory called "ReconnectAfterSend". Open this directory.
  2. Open Notepad and edit the batch file "ReconnectAfterSend.bat". When using -tolist , -to is ignored, so you can leave that unchanged. Change the values of the parameters -from and -server to your email address and your mail server name, respectively.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and you should see output similar to the following. In a more realistic setting with hundreds of recipients, you might omit the use of -recipientlimit , in which case each mail sent would be addressed to 100 recipients (the default recipient limit) but there would still be a disconnect / reconnect cycle between each email sent.

NOTE: There may be cases in which your SMTP server imposes both "per-connection" and "mails per unit time" limitations. In such cases, use both -reconnectaftersend and -sendwait to send mass mailiings successfully. See this example for use of -sendwait .

Connecting to smtp.mycompany.com

Preparing message

Adding TO(1): 001@test.com

Adding TO(2): 002@test.com

Adding TO(3): 003@test.com

Sending message

Sent to mail server

Disconnecting

Connecting to smtp.mycompany.com

Preparing message

Adding TO(4): 004@test.com

Adding TO(5): 005@test.com

Adding TO(6): 006@test.com

Sending message

Sent to mail server

Disconnecting

Connecting to smtp.mycompany.com

Preparing message

Adding TO(7): 007@test.com

Adding TO(8): 008@test.com

Adding TO(9): 009@test.com

Sending message

Sent to mail server

Disconnecting

Connecting to smtp.mycompany.com

Preparing message

Adding TO(10): 010@test.com

Adding TO(11): 011@test.com

Adding TO(12): 012@test.com

Sending message

Sent to mail server

Disconnecting

Connecting to smtp.mycompany.com

Preparing message

Adding TO(13): 013@test.com

Adding TO(14): 014@test.com

Adding TO(15): 015@test.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 15 recipients


Changing the Delimiter in Log and List Files

Purpose

This example demonstrates how to use NetMailBot's -delimiter parameter to alter the character(s) used to delimit email addresses logged in good, bad, and suspect email logs (recall that these are generated with the -loggoodemail , -logbademail , and -logsuspectemail parameters, respectively). This can be useful if you need to use a different delimiter than the default, which is a space.

NOTE: Carriage Return / Line Feed (CR/LF) cannot be used as the delimiter.

NOTE: -delimiter also determines what delimiting character(s) to expect in email list files specified in the -tolist , -cclist , and -bcclist parameters. Therefore, using -delimiter makes it a requirement that the same delimiter be used both in generated good / bad / suspect log files and multiple-recipient list files (for -tolist , -cclist , and -bcclist ).

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains two files:

  • CustomDelimiter.bat - The batch file that will instruct NetMailBot to send the email message.
  • cclist.txt - a list of email addresses to CC: to.

Batch File Contents

This is the content of the batch file:

NetMailBot -to test@exclamationsoft.com -body "Using a Customized Delimiter" -cclist "cclist.txt" -from test@exclamationsoft.com -server smtp.mycompany.com -subject "Customized Delimiter" -delimeter ":" -loggoodemail "goodmails.txt" -logbademail "bademails.txt" -recipientlimit 2

This is the content of the cclist.txt file:

001@test.com:002@test.com:003@test.com:004@test.com

Steps

  1. Unzip the CustomDelimiter.zip file. This will produce a directory called "CustomDelimiter". Open this directory.
  2. Open Notepad and edit the batch file "CustomDelimiter.bat". Change the values of the parameters -to, -from, and -server to two email addresses of your choosing and your mail server.
  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailbot should start up and you should see output similar to the following. In a more realistic setting you might have hundreds of "CC:" recipients and thus might omit the use of -recipientlimit. In that case each mail sent would be addressed to the "To:" recipient plus 100 "Cc:" recipients (the default recipient limit).

NOTE: Thus, when sending to "Cc:" or "Bcc:" recipients, the "To:" address is ignored in the count specified by -recipientlimit . This is reflected in the output below: each mail has two "Cc:" recipients, and -recipientlimit was set to 2.

Connecting to smtp.comcast.net

Preparing message

Adding TO(1): test@exclamationsoft.com

Adding CC(2): 001@test.com

Adding CC(3): 002@test.com

Sending message

Sent to mail server

Preparing message

Adding TO(4): test@exclamationsoft.com

Adding CC(5): 003@test.com

Adding CC(6): 004@test.com

Sending message

Sent to mail server

Disconnecting

Mail sent successfully to 6 recipients

Here is the "goodemails.txt" log file resulting from the above operation (using our custom delimiter):

test@exclamationsoft.com:001@test.com:002@test.com:test@exclamationsoft.com:003@test.com:004@test.com:

NOTE: You may be wondering about our test "Cc:" email addresses in this example: they seem to be "bogus" addresses, so why did they show up in the "goodemails.txt" file? Did we receive any bounces? The answer is no.

By definition, a "bounced" email is one that has been returned, after a period of time, because the sending SMTP server cannot contact the domain of the email address being sent to.

During the send, our SMTP server is not verifying the validity of the email addresses used. Therefore, none of them go into the "bad" category. The bad and suspect log files are mainly used for the verification functionality of NetMailBot and are hardly ever populated when just sending email. We have included -logbademail here just to illustrate this dynamic.

We say "mainly" and "hardly" because only about 1% of SMTP servers will lookup an email address without being explicitly asked to verify it, and an address might show up in the "bad" category if it is malformed, like "akjdlfjslf" (no domain specified) or if it is in the same domain as the mail server, but the mail server does not recognize it as being valid. This behavior varies from server to server. For instance, suppose we are using the server smtp.mycompany.com to send email with NetMailBot. An address like akjfljslkfjlasj@mycompany.com could be rejected by this server because it is not a valid email address on the mycompany.com domain.

NOTE: Email address verification is maintained in NetMailBot only for backward compatibility with older versions, but is no longer a supported feature.


POP3 Email Receiving

NetMailBot, in addition to its email sending capabilities, can also retrieve mails from a POP3 server. Here we introduce the basics of these features and then discuss periodic POP3 account monitoring, in which NetMailBot will monitor a POP3 account for the appearance of new mails and take actions accordingly that you can specify.


Basic Examples

Here we discuss the basics of connecting to a POP3 server, determining how many emails are in the specified account and how much space they take occupy (in bytes), and retrieving the mails or parts of mails.

We also cover the auto-reply capabilities of NetMailBot which can come in very handy when you might need to reply to incoming mails but cannot be physically present to do it. You can optionally have detected mails forwarded to another address as well.


Introduction: Retrieving Emails

The NetMailBot Command Line

Recall that you will need at minimum four things to retrieve email:

  • The name of your POP3 server. Your ISP or system adminstrator should be able to tell you this (e.g. pop.mycompany.com).
  • An email account on the server. Example, jdoe@hotmail.com or your email address.
  • The password for the above-mentioned account.
  • At least one message in your Inbox at this account.

In a DOS Command Window, type the following, filling in your particular details for the placeholders below:

NetMailBot -retrieve -popreceive 1 -popuser {your email address here} -poppassword {your account password here} -popserver {your POP3 server name here} (Press Enter)

This is the simplest invocation of NetMailBot mail reception possible - the first email in your Inbox will be retrieved and its parts saved to your System Temporary Directory . In this example we are not using a batch file, just a straight command line invocation.

The Results

Once you type the above and press the Enter key, you will see something similar to to the following:

Connecting to mail.mycompany.com...

Connected

Receiving Message 1...

Message 1 Received and Saved

From: joe.blow@othercompany.com

Subject: test message

Message-Id: <000c01c4662b$1b485a90$64dfa8c0@mypc>

# of attachments: 0

Disconnected

-------***[ NetMailBot Ended: 07/09/2004 23:17:04]***-------

If you see the text "Message 1 Received and Saved", then you have successfully retrieved the first email in your Inbox.

For a simple email (this one was sent from Microsoft Outlook Express):

From: Suzie Q

Date: Friday, July 09, 2004 11:07 PM

To: Joe Blow

Subject: test message

test body

The System Temporary Directory will contain two files:

text_plain1.txt

text_html1.html

Each simply contains the body of the message, in this case, "test body" (the HTML file is this text wrapped in minimal HTML tags).

If you do not see the success message, check the error message that NetMailBot displayed.

  • Did you enter the correct email server name, user email address, and password?
  • Are you sure there is actually an email in your Inbox to be had?

If you are still having problems, contact ExclamationSoft support for assistance .


Retrieve an Email from a POP3 Server

Purpose

This example demonstrates how to retrieve an email from a POP3 server and save the message's contents on your hard drive. The message will not be deleted from your POP3 account, so you could actually retrieve it again if you needed to.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • RetrieveAnEmail.bat - The batch file that will instruct NetMailBot to retrieve the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popreceive 1 -popserver localhost -popuser email@domain.com -poppassword secret

pause

Steps

  1. Unzip the RetrieveAnEmail.zip file. This will produce a directory called "RetrieveAnEmail". Open this directory.
  2. Open Notepad and edit the batch file "RetrieveAnEmail.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory . The original message should still be in your POP3 account's message queue.


Get POP3 User Account Statistics

Purpose

This example demonstrates how to get statistics for a POP3 user account. The two statistics provided are:

  • Message count
  • Total message size in bytes

Additional Prerequisites

In order for this example to provide any interesting information, the user account you specify should have at least one email message on the POP server. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • GetStatistics.bat - The batch file that will instruct NetMailBot to retrieve the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popstatistics -popserver localhost -popuser email@domain.com -poppassword secret

pause

Steps

  1. Unzip the GetStatistics.zip file. This will produce a directory called "GetStatistics". Open this directory.
  2. Open Notepad and edit the batch file "GetStatistics.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. The statistics for the specified user account will be displayed as exemplified below:

-------***[ NetMailBot 4.0 Build 0 Started: 10/02/2003 21:19:01 ]***----

The log file, \log_pop.txt, has been created

Connecting to mail.domain.com...

Connected

Getting Statistics...

Total Messages: 3

Total Bytes: 46670

Disconnected

Total operation time: 297 ms

-------***[ NetMailBot Ended: 10/02/2003 21:19:02]***-------


Retrieve an Email Message Header

Purpose

This example demonstrates how to retrieve an email message header from a POP3 server and save the message's contents on a hard drive. Headers contain information about an email message which can be useful for message parsing and processing.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • RetrieveHeader.bat - The batch file that will instruct NetMailBot to retrieve the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popheader 1 -popserver localhost -popuser email@domain.com -poppassword secret

pause

Steps

  1. Unzip the RetrieveHeader.zip file. This will produce a directory called "RetrieveHeader". Open this directory.
  2. Open Notepad and edit the batch file "RetrieveHeader.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message header from your POP3 mail server should be downloaded and saved to your hard drive with the filename "header[message number].txt" in a folder named "pop3" under your System Temporary Directory .


Delete an Email

Purpose

This example demonstrates how to delete an email on a POP3 email server; the mails are not automatically deleted from the server when you use -popreceive ; they must be explicitly deleted with -popdelete .

** WARNING ** This example will delete an email for the specified user account on the specified POP3 email server. You should use a test account for this example to ensure that critical data is not accidentally deleted.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • DeleteAnEmail.bat - The batch file that will instruct NetMailBot to retrieve the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popdelete 1 -popserver localhost -popuser email@domain.com -poppassword secret

pause

Steps

  1. Unzip the DeleteAnEmail.zip file. This will produce a directory called "DeleteAnEmail". Open this directory.
  2. Open Notepad and edit the batch file "DeleteAnEmail.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. NetMailBot should display that the message was deleted.


Auto-Reply to an Email

Purpose

This example demonstrates how to configure an auto-reply to an incoming email. This feature is useful for monitoring a POP3 email account for new email messages that you wish to auto-reply to.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. If you need to do so, an email can be sent to the account you specify by using one of our other examples; click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • AutoReply.bat - The batch file that will instruct NetMailBot to retrieve the email message and auto-reply to it.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popreply 1 -popserver mail.domain.com -popuser email@domain.com -poppassword secret -body "Thank you for your interest!" -from email@domain.com -server mail.domain.com

@echo %ERRORLEVEL%

pause

Steps

  1. Unzip the AutoReply.zip file. This will produce a directory called "AutoReply". Open this directory.
  2. Open Notepad and edit the batch file "AutoReply.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name
  • -from to the address from which the reply should come ("From:")
  • -server to an SMTP mail server through which you can send the outgoing auto-reply

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

NOTE: Recall that your SMTP server may require authentication; see this example for more information.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory .
  5. After the email message is downloaded, a reply will be sent.


Forward an Email

Purpose

This example demonstrates how to retrieve an email from a POP3 server and forward it to another email address.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • Forward.bat - The batch file that will instruct NetMailBot to retrieve the email message and auto-reply to it.

Batch File Contents

This is the content of the batch file:

NetMailBot.exe -receive -popforward -popreceive 1 -popserver localhost -popuser email@domain.com -poppassword secret -to email@domain.com -from email@domain.com -server localhost

pause

Steps

  1. Unzip the Forward.zip file. This will produce a directory called "Forward". Open this directory.
  2. Open Notepad and edit the batch file "Forward.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name
  • -to to an email address where the message can be forwarded
  • -from to an email address to be used as the "From:" address
  • -server to an SMTP mail server through which you can send the outgoing auto-reply

NOTE: The parameter -receive is required whenever using the POP3 parameters; this parameter puts NetMailBot into what might be called "POP3 mode" as opposed to "SMTP mode" which is for sending mails.

NOTE: Recall that your SMTP server may require authentication; see this example for more information.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory .
  5. The downloaded email message should have been sent (forwarded) to the email address specified with the -to parameter.


Periodic Account Monitoring

It can be very useful to be able to automatically keep an eye on a POP3 account for incoming mails and then to take specific followup actions.

You can set NetMailBot up to check a POP3 account on a periodic schedule, retrieve messages, automatically reply to them, and delete or forward the retrieved messages as well.


Check Every 5s, Retrieve, then Delete

Purpose

This example demonstrates how to check an email account on a POP3 server every 5 seconds for new messages, retrieve any messages, then delete them from the POP3 server.

** WARNING ** This example will delete all emails for the specified user account on the specified POP3 email server. You should use a test account for this example to ensure that critical data is not accidentally deleted.

Why Use this Feature?

This feature is useful for monitoring a POP3 email account for new email messages that you wish to retrieve on a regular basis. One might use this feature to retrieve a message that contains an attachment.

For example, if a company has a number of satelite offices that send daily reports to a single email address for collation, one would use this feature to monitor that email account and automatically save the attachment.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • FiveSecCheckDelete.bat - The batch file that will instruct NetMailBot to perform the desired actions.

Batch File Contents

This is the content of the batch file:

NetMailBot -receive -popreceive -popwatch -popwait 5000 -popdelete -popserver mail.domain.com -popuser email@domain.com -poppassword test

pause

Steps

  1. Unzip the FiveSecCheckDelete.zip file. This will produce a directory called "FiveSecCheckDelete". Open this directory.
  2. Open Notepad and edit the batch file "FiveSecCheckDelete.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name

NOTE: The parameter -receive is required whenever using the POP3 parameters.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory .
  5. After the email message is downloaded, it will be deleted from the POP3 mail server.


Check Every 5s, Retrieve, Forward, then Delete

Purpose

This example demonstrates the ease and flexibility of auto-forwarding messages to a different email address. There are four major actions:

  1. Check an email account every 5 seconds for new messages
  2. Retrieve all messages
  3. Forward all messages
  4. Delete all messages

** WARNING ** This example will delete all emails for the specified user account on the specified POP3 email server. You should use a test account for this example to ensure that critical data is not accidentally deleted.

Why Use this Feature?

This feature is useful for monitoring a POP3 email account for new email messages that you wish to retrieve on a regular basis and forward to another email address.

For example, suppose a company has a special email account for general inquiries. The handling of the incoming inquiries is done by different people (perhaps they rotate week on week or the usual person goes on vacation), this feature could be used to forward the inquiry emails to whomever is responsible to handle them for a given time period.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • FiveSecCheckForwardDelete.bat - The batch file that will instruct NetMailBot to perform the desired actions.

Batch File Contents

This is the content of the batch file:

NetMailBot -receive -popwatch -popwatchwait 5000 -popdelete -server mail.domain.com -popuser email@domain.com -poppassword test -popforward -to email@domain.com -from email@domain.com -popserver mail.domain.com

pause

Steps

  1. Unzip the FiveSecCheckForwardDelete.zip file. This will produce a directory called "FiveSecCheckForwardDelete". Open this directory.
  2. Open Notepad and edit the batch file "FiveSecCheckForwardDelete.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name
  • -to to another email address
  • -from to another email address
  • -server to an SMTP mail server to send the mail through

NOTE: The parameter -receive is required whenever using the POP3 parameters.

NOTE: Notice that we are not using the parameter -popreceive : this is because we are not actually storing the messages on the local hard drive "permanently" - they are only temporarily stored by NetMailBot for the purposes of forwarding them. -popreceive causes NetMailBot to store the messages (or their parts) in a directory of your choosing.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory .
  5. After the email message is downloaded, it will be forwarded to the email address specified with the -to parameter.
  6. After the email message is forwarded, it will be deleted from the POP3 mail server.


Check Every 5s, Retrieve, Reply, then Delete

Purpose

This example demonstrates the ease and flexibility of auto-replying to messages. There are four major actions:

  1. Check an email account every 5 seconds for new messages
  2. Retrieve all messages
  3. Reply to all messages
  4. Delete all messages

** WARNING ** This example will delete all emails for the specified user account on the specified POP3 email server. You should use a test account for this example to ensure that critical data is not accidentally deleted.

Why Use this Feature?

This feature is useful for monitoring a POP3 email account for new email messages that you wish to auto-reply to.

For example, suppose a company has a special email account for support inquiries. The handling of the incoming support requests is done by different people who are assigned the cases based upon their current workload. The emails are stored on the local hard drive by NetMailBot (to be handed out to the support staff) but in order to let the customer sending the inquiry know that it has been received, this feature could be used to auto-reply to the inquiry emails in a timely fashion. Perhaps the auto-reply mail would just acknowledge the request and would tell the sender to expect a response from a support staff member within some agreed timeframe.

Additional Prerequisites

The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • FiveSecCheckReplyDelete.bat - The batch file that will instruct NetMailBot to perform the desired actions.

Batch File Contents

This is the content of the batch file:

NetMailBot -receive -popwatch -popwatchwait 5000 -popdelete -server mail.domain.com -popuser email@domain.com -poppassword test -popreply -from email@domain.com -body "Thanks!" -popserver mail.domain.com

pause

Steps

  1. Unzip the FiveSecCheckReplyDelete.zip file. This will produce a directory called "FiveSecCheckReplyDelete". Open this directory.
  2. Open Notepad and edit the batch file "FiveSecCheckReplyDelete.bat". Change the values of the following parameters:
  • -popuser to your own user account
  • -poppassword to your user account's password
  • -popserver to your user account's POP3 mail server name
  • -from to whatever email address should be the "From:" address
  • -server to an SMTP mail server to send the mail through

NOTE: The parameter -receive is required whenever using the POP3 parameters.

NOTE: Note that absence of the -to parameter. Aren't we sending an email when we reply to an email? Normally, -to is always required in NetMailBot when we are sending email, but this is the exception: when using -popreply, the "To:" field of the reply message is automatically set to the email address that the original email was "From:". For example, joe@test.com sends an email to info@xyz.com, and the latter uses NetMailBot to automatically reply to such information inquiries. NetMailBot will assume that the reply in this case should be "To:" joe@test.com.

  3. Invoke the batch file by double-clicking the icon or straight from the command line.
  4. An email message from your POP3 mail server should be downloaded and the message parts should be saved to your hard drive in a folder named "pop3" under your System Temporary Directory .
  5. After the email message is downloaded, a reply will be sent with the simple message body of "Thanks!".
  6. After the email message is replied to, it will be deleted from the POP3 mail server.


Run as a Windows Service

Another level of automation can be reached by running NetMailBot as a Windows Service in the background, instead of manually starting it up each time you want to use it. This section introduces this concept and then shows you how to do it.


Introduction: Running NetMailBot as a Service

Allowing NetMailBot to Automatically Execute via a Background (Service) Process

Running NetMailBot as a Windows service allows one or more NetMailBot batch files to run in the background without user intervention. In this situation NetMailBot is immediately running when the computer starts and does not require that a user log in (Windows NT/2000/2003/XP) and manually launch a batch file from either the command line or a .bat file icon. An additional benefit is that there is no window in which a background process runs - it is completely hidden from view. Thus, running NetMailBot as a Windows Service provides a lower level of "set and forget" automation.

The service "NMBService.exe" is a small program that coordinates the execution of one or more batch files. It's job is to launch all of the specified processes (NetMailBot batch files in our case) when it is started. Any Windows Service including NMBService.exe can be configured to start manually or automatically (when Windows starts). See the Services icon in your WIndows Control Panel or System Tools folder.


Contents of the NMBService.ini File

Purpose

NetMailBot instances running under a Windows service are configured with a file called NMBService.ini. Here are the details on the format of this file. The program NMBService.exe is the actual service program that keeps track of some number of NetMailBot.exe processes as configured by you in the NMBService.ini file.

The file is divided into a Setting section and one or more Process sections. Each section starts with the appropriate section heading and each contains the appropriate settings. The headings and settings are described in the table below. See the examples in this section of the manual for actual examples of NMBService.ini files.

This table describes the headings and settings used in the NMBService.ini file. The values given are examples; you can set them to whatever values you prefer.

Heading or Setting Name

Description

[Settings]

Section heading. Required.

ServiceName = NMBService

The name of the service as it will appear under Control Panel -> Administrative Tools -> Services.

ProcCount = 1

The number of [Process#] sections below. For each additional [Process#] section that is added, this number must be incremented.

CheckProcess = 60

The number of seconds that specify the frequency which the NMBService process will check the processes below to ensure they are running/responding.

[Process0]

Section heading. Required. Each process section represents a batch file or NetMailBot command with parameters to run. If adding a new process, increase the number by one. For example, to add a new process after the [Process0] section, add a section named [Process1].

CommandLine = <cmd line>

The program/executable/batch file to run with or without parameters. This looks just like a "typical" NetMailBot command line invocation that you would store in a .bat file or run directly at the DOS prompt, e.g.:

C:\Program Files\NetMailBot\netmailbot -receive -popforward -popreceive 1 -popserver localhost -popuser email@domain.com -poppassword secret -to email@domain.com -from email@domain.com -server localhost

WorkingDir = <dir>

The working directory for the program/executable/batch file where supporting files may be located. For example:

C:\Program Files\NetMailBot

PauseStart = 0

Number of milliseconds to pause before starting the process when the service is started.

PauseEnd = 3000

Number of milliseconds to wait when the service stop request is made. This allows the process time to exit gracefully before the service is stopped and the child processes terminated.

UserInterface = No

Specifies whether to show or hide any type of GUI including a DOS command prompt. Values: Yes/No

Restart = No

Specifies whether to restart the process if it stops or exits for any reason. Values: Yes/No.


Watch a Directory as a Service

Purpose

This example demonstrates how to use the watch directory features of NetMailBot while running NetMailBot as a Windows Service.

Specifically, a directory is watched for new files, when new files are found, they are sent to the recipient as an email attachment. After the email is sent, the files in the directory being watched are moved to the specified directory.

Additional Prerequisites

  • This example works only on Windows NT / 2000 / XP / 2003.
  • Adminstrator privelege is required to install and run NetMailBot as a Windows Service.

Prepared Example Files

A template for this example is provided in the ZIP archive available here.

The .ini file (discussed below) in this example uses full paths and assumes that the .zip file has been expanded to C:\tmp. Therefore, download this .zip file to C:\tmp on your hard drive or edit the .ini file to reflect wherever you unzip the archive.

The archive contains ten files:

  • NMBService.exe - The NetMailBot helper program for running NetMailBot as a Windows Service
  • NMBService.ini
  • NMBStart Service.bat
  • NMBStop Service.bat
  • NMBService Install.bat
  • NMBService UNInstall.bat
  • watch\attach1.txt - A file to attach
  • watch\attach2.txt - A file to attach
  • watch\attach3.txt - A file to attach

File Contents

This is the content of the NMBService.ini file:

[Settings]

ServiceName = NMBService

ProcCount = 1

CheckProcess = 60

[Process0]

CommandLine = C:\Program Files\NetMailBot\netmailbot -to email@domain.com -from email@domain.com -server localhost -watchdir "c:\tmp\watch" -watchmoveto "c:\tmp" -logfile "c:\tmp\log.txt"

WorkingDir = C:\Program Files\NetMailBot

PauseStart = 0

PauseEnd = 3000

UserInterface = No

Restart = No

All of the .bat files invoke NMBService.exe with various parameters to effect the desired outcome.

This is the content of the NMBStart Service.bat file:

NMBService -r NMBService

This is the content of the NMBStop Service.bat file:

NMBService -k NMBService

This is the content of the NMBService Install.bat file:

NMBService -k NMBService

NMBService -u

NMBService -i

NMBService -r NMBService

@pause

This is the content of the NMBService UNInstall.bat file:

NMBService -k NMBService

NMBService -u

pause

Steps

  1. Unzip the DirectoryWatchAsAService.zip file into C:\tmp. This file contains no internal directories. The files listed above will appear directly in C:\tmp.
  2. Open Notepad and edit the file NMBService.ini, changing the following:
  • Ensure the path to NetMailBot is correct. By default, it is C:\Program Files\NetMailBot
  • -server to your mail server
  • -to to an email address where the email resulting from the watch can be sent.
  • -from to an email address that can be used as the "From:" email address
  • The parameter -watchdir "c:\tmp\watch" instructs NetMailBot to watch the directory "c:\tmp\watch" for files to send as attachments to the -to email address.
  • The parameter -watchmoveto "c:\tmp" instructs NetMailBot to move the files in the directory "c:\tmp\watch" to the directory "c:\tmp" after the email is sent.
  3. Invoke the batch file "NMBService Install.bat" to install the Windows Service helper program.
  4. Ensure that the service and NetMailBot are running. Open Task Manager, select the "Processes" tab, and look for the two processes "netmailbot.exe" and "NMBService.exe".
  5. Go to the directory "c:\tmp\watch" to ensure the files no longer exist and check the directory "c:\tmp" to ensure the attach*.* files now exist there.
  6. Check your email account Inbox for an email containing the file attachments.
  7. To uninstall the service, execute the batch file "NMBService UNInstall.bat".


Forward Email as a Service

Purpose

This example demonstrates how to use the email forwarding features of NetMailBot while running NetMailBot as a Windows Service.

Specifically, a POP3 user account is monitored for new messages. When new messages are found, they are forwarded to the specified recipient. After the email is forwarded, the original email messages in the POP3 user account are deleted.

Additional Prerequisites

  • The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .
  • This example works only on Windows NT / 2000 / XP / 2003.
  • Adminstrator privelege is required to install and run NetMailBot as a Windows Service.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains six files:

  • NMBService.exe - The NetMailBot helper program for running NetMailBot as a Windows Service
  • NMBService.ini
  • NMBStart Service.bat
  • NMBStop Service.bat
  • NMBService Install.bat
  • NMBService UNInstall.bat

File Contents

This is the content of the NMBService.ini file:

[Settings]

ServiceName = NMBService

ProcCount = 1

CheckProcess = 60

[Process0]

CommandLine = C:\Program Files\NetMailBot\netmailbot -receive -popforward -popreceive 1 -popserver localhost -popuser email@domain.com -poppassword secret -to email@domain.com -from email@domain.com -server localhost

WorkingDir = C:\Program Files\NetMailBot

PauseStart = 0

PauseEnd = 3000

UserInterface = No

Restart = No

All of the .bat files invoke NMBService.exe with various parameters to effect the desired outcome.

The contents of the .bat files are the same as in the Watch as a Service example.

Steps

  1. Unzip the ForwardAsAService.zip file. This will produce a directory called "ForwardAsAService". Open this directory.
  2. Open Notepad and edit the file NMBService.ini, changing the following:
  • Ensure the path to NetMailBot is correct. By default, it is C:\Program Files\NetMailBot
  • -popuser to your own POP3 user account.
  • -poppassword to the POP3 user account password.
  • -popserver to the name of the user account's POP3 email server.
  • -to to an email address where the retrieved messages can be forwarded.
  • -from to an email address that can be used as the "From:" email address
  • -server to an SMTP server to send the forwarded email through
  3. Invoke the batch file "NMBService Install.bat" to install the Windows Service helper program.
  4. Ensure that the service and NetMailBot are running. Open Task Manager, select the "Processes" tab, and look for the two processes "netmailbot.exe" and "NMBService.exe".
  5. Check your email account Inbox for email forwarded from the user account you have specified.
  6. To uninstall the service, execute the batch file "NMBService UNInstall.bat".


Auto-Reply as a Service

Purpose

This example demonstrates how to use the email auto-reply features of NetMailBot while running NetMailBot as a Windows Service.

Specifically, a POP3 user account is monitored for new messages. When new messages are found, they are replied to. After the email is replied to, the original email messages in the POP3 user account are deleted.

Additional Prerequisites

  • The user account you specify should have at least one email message on the POP server in order for this example to work. An email can be sent to the account you specify with a different example, click here .
  • This example works only on Windows NT / 2000 / XP / 2003.
  • Adminstrator privelege is required to install and run NetMailBot as a Windows Service.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains six files:

  • NMBService.exe - The NetMailBot helper program for running NetMailBot as a Windows Service
  • NMBService.ini
  • NMBStart Service.bat
  • NMBStop Service.bat
  • NMBService Install.bat
  • NMBService UNInstall.bat

File Contents

This is the content of the NMBService.ini file:

[Settings]

ServiceName = NMBService

ProcCount = 1

CheckProcess = 60

[Process0]

CommandLine = C:\Program Files\NetMailBot\netmailbot -receive -popwatch -popwatchwait 5000 -popdelete -popserver localhost -popuser email@domain.com -poppassword secret -popreply -from email@domain.com -body "Thanks!" -server localhost

WorkingDir = C:\Program Files\NetMailBot

PauseStart = 0

PauseEnd = 3000

UserInterface = No

Restart = No

All of the .bat files invoke NMBService.exe with various parameters to effect the desired outcome.

The contents of the .bat files are the same as in the Watch as a Service example.

Steps

  1. Unzip the ForwardAsAService.zip file. This will produce a directory called "ForwardAsAService". Open this directory.
  2. Open Notepad and edit the file NMBService.ini, changing the following:
  • Ensure the path to NetMailBot is correct. By default, it is C:\Program Files\NetMailBot
  • -popuser to your own POP3 user account.
  • -poppassword to the POP3 user account password.
  • -popserver to the name of the user account's POP3 email server.
  • -to to an email address where the retrieved messages can be forwarded.
  • -from to an email address that can be used as the "From:" email address
  • -server to an SMTP server to send the forwarded email through
  3. Invoke the batch file "NMBService Install.bat" to install the Windows Service helper program.
  4. Ensure that the service and NetMailBot are running. Open Task Manager, select the "Processes" tab, and look for the two processes "netmailbot.exe" and "NMBService.exe".
  5. Check your email account Inbox for email replied to from the user account you have specified.
  6. To uninstall the service, execute the batch file "NMBService UNInstall.bat".


Advanced

This section contains various advanced examples and topics for NetMailBot use.


Using the Task Scheduler

Objective

One common use for NetMailBot is to routinely send out emails using the Windows Task Scheduler. This example will guide you through setting up a Scheduled Task that will run every Monday morning at 6:00 a.m.

For easier set-up, you should first create a batch file. Click here for an example of a batch file.

Requirements

  • Windows 95 - You will need to have Internet Explorer 4.0 or higher installed.

Create a New Task for the Scheduler

  1. Open the Windows Scheduler. Use Start Menu->Programs->Accessories->System Tools->Scheduled Tasks. Then, add a scheduled task.

  2. A wizard will appear to help walk you through the steps of creating a scheduled task. Click on the "Next" button.

  3. The next screen in the wizard prompts for a program to run. Click on the "Browse" button.

  4. The "Select Program to Schedule" dialog will appear (it may appear slightly different on your computer). Go to the location of NetMailBot program or batch file you have created. For this example, we will schedule a task using the batch file created in the previous example ( Click here to see that example ). Navigate to the directory where it exists and click the "Open" button.

  5. Next, select the frequency you would like the task to run. For this example, choose "Weekly", then click the "Next" button.

  6. Next, select the day and time to run the task. For this example, change the time to 6:00a.m. and check the box next to "Monday". Click on the "Next". button.

  7. Note for Windows 2000 users: You will see an additional step in the wizard prompting you for a user name and password for the task to use when running this task. You should provide a user id and password that has privileges to use NetMailBot in this case.
  8. You will now see the last step in the wizard. Click the "Finish" button.


Drag and Drop an Attachment to Send

Purpose

This example demonstrates how to create a batch file on your desktop that you can drop files onto, which are sent to a pre-specified email address.

Note the "%1" below (in the batch file listing) instead of naming the attachment. This tells the batch file to attach the file being dropped on it.

Prepared Example Files

A template for this example is provided in the ZIP archive available here. Download this file to a suitable place on your hard drive.

The archive contains one file:

  • DragDropAttach.bat - The batch file that will instruct NetMailBot to send the email message.

Batch File Contents

This is the content of the batch file:

NetMailBot -to to@mailserver.com -from from@mailserver.com -subject "%1" -server mail.mailserver.com -attachment "%1"

Steps

  1. Unzip the DragDropAttach.zip file. This will produce a directory called "DragDropAttach". Open this directory.
  2. Open Notepad and edit the batch file "Drop Email.bat". Change the values of the parameters -to, -from, and -server to appropriate settings.
  3. Copy the Drop Email.bat file to your desktop.
  4. Drag and drop a file onto the Drop Email.bat file as shown below:

  5. NetMailbot should start up and, upon finishing, the email addresses specified with the -to parameter should each receive an email message with the dropped attachment included!


Usage Scenarios

Purpose

We have produced the following business case / usage scenarios to give typical examples of NetMailBot use and to ignite your imagination in finding new and creative ways to employ NetMailBot in your everyday work.

The examples illustrate use of NetMailBot's features in various business domains and situations.

Some examples are fictional, coming purely from our imaginations (but describing how NetMailBot can be used) and others come from actual ways our customers use NetMailBot. We often find that customers come up with new and interesting applications we would never have thought of!


Staggered Mailings

Introduction

NetMailBot can be used to send out “staggered” mass mailings when you need to make some kind of announcement that requires a response from your recipients, but you must control the rate at which the responses come in for various resource-related reasons. Perhaps your staff can only handle so many responses at a time, or having too many responses at once could overload some computing resource, such as a server. In a staggered mailing, you send emails to a list of recipients in manageable batches with delays in between. For example, if there are 1000 recipients, you might send emails to them 50 at a time, waiting twenty minutes in between each send.

One Scenario: Coordinating IT Upgrades in a Controlled Manner

Suppose you have a database on a central server that is used by your field sales force, and they use client software to access the database while out on the road. It becomes necessary to upgrade the software on the server, and afterwards the field staff will have to make some adjustments to their client programs in order to access the new server configuration. It is expected that the staff may need some live help from the IT department in configuring the new settings. Using NetMailBot, you could both announce the server upgrade to occur at some date and time, and send a staggered email to the field staff so that your IT staff can handle any incoming calls for assistance.

Another Scenario: Controlling Mass Email Campaign Response Rate

Another classic use of staggered mails is mass marketing campaigns. If your marketing group has used this technique for some time, perhaps they are used to getting a certain rate of responses to campaigns and have learned how many resultant leads they can manageably capture, respond to, and pass on to the sales group at a time. Thus they need to "throttle" the rate at which they send the campaign emails to contacts in their database of target audiences so as not to get overwhelmed with too many responses at once (well, perhaps that would be a good problem to have).


Send Targeted Email "Special Announcements"

Perhaps you are a software company running a seasonal special on one of your products and you have a set of potential customers that might just need that little extra incentive to go ahead and buy your product.

Or, your company is enjoying rapid but stable growth and you have just hired a new CEO. You want to tell market analysts, tradespeople, industry publication contacts, and any other applicable people in your relationship management database about the new leadership and your company's bright new direction.

NetMailBot's database connectivity can help greatly in automating the sending of different mass email campaigns to different target audiences. By making campaign differentiation part of your database, you can automate and control when each campaign goes out and to whom, including, of course, some sort of response codes in the campaign mails so that you can match responses to campaigns to determine which were the most effective. NetMailBot could even be part of your lead followup email efforts - after using the POP3 functions to download responses to your campaign, you could use some external processing to make sense of the campaign codes, update your database, and launch NetMailBot again to follow up on the hot leads.

Time zones could also be a factor controlling when your campaign mails go out. NetMailBot's ability to use the information in your database allows you great flexibility in automating these sorts of email campaigns.


Alert a System Administrator to Important System Events

Alert a System Administrator to Important Events

NetMailBot can be a great helper to System Administrators needing to keep an eye on important events within their IT infrastructure.

For example, NetMailBot's directory watching function can be used to monitor a directory for a log file of a certain size. When the log file gets "too big", it matches NetMailBot's watch settings (e.g. watch for *.log files that are greater than 1MB large). NetMailBot then emails the file as an attachment to the administrator and moves (or deletes, depending on the setting) the original file.

An administrator could also set up NetMailBot to send him- or herself a daily security report generated by the system (as before, these could be web server logs, firewall logs, etc. - just set up all of the applications to dump their ".log" files into the same directory and set up NetMailBot to watch for these). Or, the POP3 receiving functionality could be used to retrieve help requests from users. In general, NetMailBot can be used in many "event driven" ways to respond to changes of importance within your IT infrastructure.


Send Business Documents Around Your Company

Anyone working in today's office environment is no stranger to paperwork, despite promises of the "paperless office". Many functions require varied forms to be filled out, procedures to be followed, etc. Inevitably routines that were learned and practiced and accepted do change (and all too often more frequently than would seem reasonable). Thus, the need arises to keep everyone in the organization abreast of the continually new ways of doing things.

Usually, changes impact various subgroups in the organization - perhaps a new form only applies to HR staff, or a new procedure only affects how the Customer Support Representatives handle new customer issues. With NetMailBot and a database containing information about your company's organizational structure and functions, you can target these subgroups and keep "full mesh" (i.e. "CC: All") emails to a bare minimum.

It is good practice to send recipients a link to a new document instead of emailing a copy to everyone who must use it (why clog the mail server with numerous duplicates of the same thing?). NetMailBot's mail merge function can help; if the link information to each kind of document is part of the database information, the links can be customized on-the-fly for each email to any particular group.

By incorporating NetMailBot into a controlled regimen of organizational change management, you can automate these sorts of announcements. You can even use NetMailBot's POP3 reception functions to capture those unavoidable "Huh?" emails from employees that are perhaps a bit slow to change and forward them to the appropriate handler.


Send Shift Instructions to Factory Floor Workers

If aspects of the manufacturing done at your factory change each shift, and every day and shift requires some particular information applicable that day, you could use NetMailBot to send manufacturing instructions to your plant floor staff so they know how to proceed.

Perhaps each shift works on a different area of an overall manufacturing project, and you need to synchronize a shift's planned production with whatever was achieved by the previous shift. Or, maybe your shop provides contract manufacturing services - such as a machine shop making parts to customers' specifications or a printed circuit board fabrication plant - and each shift is handling some new orders or parts of orders. You could send the applicable information for each order (specific sets of manufacturing instructions, CNC machine programming instructions, or PCB layout files, to name a few) to each shift's crew. Again, this could be done automatically using shift staffing information contained in a database.


Send Scheduled Service Alerts to Car Owners

It's common practice to sell additional services, such as scheduled maintenance plans, with new car purchases. Using NetMailBot and your customer database, you could automatically remind your customers when their vehicles are due for some tender loving care.

NetMailBot can of course retrieve the customers' email addresses from the database, but you could also fetch information on what kind of car each customer has, who their service technician is, and what service package level they are at and what the services in that particular package are. Often such plans are sold according to mileage, so there is a set of services to be performed at the 5000 mile mark, the 7000, 10,000, and 15,000 mile marks, etc. Some services, such as oil and filter changes, are common to all of the packages; others are more infrequent and apply as the vehicle ages. NetMailBot's mail merge features can create, on-the-fly, a personalized email to each customer, giving them a timely and friendly reminder with all the handy details.


"Email This Page to a Friend" at Your Website

Using some additional external processing (i.e. perhaps employing NetMailBot in tandem with a back-end database), you could use NetMailBot to send an HTML web page to a recipient specified by a visitor to that page. The visitor could fill in a friend's email address, their own email address, and a short message in a form ("Thought you might like to see this!"), then click on a "Send!" button. The sender's and recipient's email addresses and the URL of the intended web page would be sent by the browser to the back end, eventually being passed to an invocation of NetMailBot, using the -bodyfile parameter to send an email with an HTML message body coming from the web page's URL.

This would of course require some mechanism to specify the URL (HTML page) from which the request was sent (perhaps your web server might support this functionality already, or you could use a hidden form element, cookie, or other technique). You could have client-side functions insert the submitted data into the database, then the database would periodically check for emails to go out. You would thus want some sort of time stamp information and a flag to indicate whether each email had yet been sent. This scenario requires a bit more work and skill, but it is certainly an interesting use of NetMailBot in a "word of mouth"-style marketing application.


Automate Blanket Orders with Your Suppliers

If your company has established relationships with a set of preferred suppliers (for everything from your raw materials - if you're a manufacturing establishment - to office supplies) you might use "blanket orders" to keep a steady stream of supplies coming in.

Suppose your organization consumes 300 reams of paper per quarter, but you are not interested in having that much paper stacked away in your offices. You set up a standing purchase order ("blanket order" - as it is sometimes called) with your office supplies vendor to order 25 reams per week. The supplies come in each week until it is time to issue a new PO for the next quarter.

Well, conveniently, your supplier is able to take orders via email, so you set up NetMailBot to send the weekly email for the order of 25 reams of paper.

Naturally, with NetMailBot's database connectivity abilities, you can greatly expand on this simple idea. Suppose you have an internal supplies ordering system on your corporate intranet. People throughout the organization can visit the system to place orders for all kinds of items by quantity, supplier, part numbers, order dates, requested delivery dates, etc. These data are stored in a database, and, after being approved by the appropriate purchasing manager or controller, can be used by NetMailBot in scheduled, recurring email transmissions to all of the applicable vendors for all standing orders. Those orders that are not flagged as approved in the database are not processed. You could also keep track of your actual use of materials, and throttle your blanket orders accordingly (for example, you only used ten reams of paper this week, so you don't need another 25 next week). NetMailBot can send customized emails automatically based on whatever database query you give it!


Update the Family on New Genealogy Discoveries

Suppose you are the family genealogist. As it takes time to fully research and flesh out the family tree, the tree grows and evolves over time and you would like a way to let the extended family know what the tree looks like from time to time.

Enter NetMailBot. Not only could you send mass notice emails to everyone in the family about the current state of the family tree, but you could send customized emails requesting various kinds of genealogical information. If you had the genealogy stored in a database, you might be able to automatically find all relatives whose siblings are unknown, or who were known to have had children but some details remain sketchy.

Using NetMailBot, you could comb the database for missing information and automatically send that email to Aunt Flo asking her exactly how many brothers and sisters her great uncle on her father's side had and what their names were.


Parameters


Introduction

Overview

This section documents each NetMailBot parameter individually and gives full details of how to use them, with an example for each.

Elements of Each Entry

Each entry contains the following elements. See below for a description of each.

Category:

A categorization of the parameters, such as "Addressing", "Attachments", etc., to help you remember where a parameter applies as you get familiar with NetMailBot and for reference later.

Description:

A brief description of what the parameter does and its purpose.

Optional?

Indicates (Yes or No) whether the parameter is optional.

Overrides:

This lists any parameters whose effects are rendered null by adding this parameter.

Overridden By:

This lists any parameters that make this parameter have no effect.

Other Parameters Required:

Many parameters can only be used in the context of using other parameters. In these cases, the other required parameters are listed here.

See Also:

Links to the other parameters of interest related to this parameter.

Usage:

This is a brief syntactic description of how to use the parameter. The parameter is shown verbatim, and placeholders are used to indicate what parameter specifiers are applied to this parameter.

Placeholders appear in angle brackets, < and >, and anything inside them (including the brackets) are replaced by an actual value in the context of use. For example, <filename> might be replaced by myfile.txt.

All other characters shown (or spaces) are required. For example, the usage of -attachment below shows that filenames are put in quotes and separated by spaces:

-attachment "<filename1>" "<filename2>" [...]

We use the symbol [...] to indicate "more of the same, optionally". This symbol is not typed when you use the parameter; it is just another kind of placeholder for the purposes of this documentation. Thus, a valid, concrete use of -attachment using more than two attachment filenames is:

-attachment "log.txt" "timestamps.txt" "current_status.xls" "daily_report.pdf"

Example:

This gives an example of using the parameter within a complete NetMailBot invocation.

Comments:

Additional comments about the parameter are listed here.

Important: Paths in NetMailBot

As a general rule, all parameters that take filenames as sub-parameters can use either relative paths or fully qualified paths:

-attachment "log.txt"

(a relative path; the file log.txt must be in the same directory as the batch file) vs. a fully qualified path:

-attachment "c:\my directory\log files\log.txt"

However, in practice, it is best to use fully qualified paths whenever possible to prevent the possibility of referring to a file that cannot be found by NetMailBot.

Quoting Parameter Specifiers

Quotes around parameter specifiers are, in general, optional, e.g.:

-addrecipient "joe@mycompany.com"

vs.

-addrecipient joe@mycompany.com

Quotes are, however, necessary if specifying a parameter such as:

-body "this is the body"

If we didn't use quotes:

-body this is the body

...then NetMailBot would think that the body is only "this" and "is" is a new parameter.

For consistency, you might choose to always use quotes.

In this chapter, in our coverage of the individual parameters, we have typically used quotes with those parameter specifiers that might be likely to contain spaces, such as paths (even in specific examples that don't contain spaces, e.g. "c:\tmp\myfile.txt"). For other parameter specifiers we have omitted the quotes.

Spaces and Commas

Spaces are used to delimit parameters and switches.

Some parameters (e.g. -addrecipient ) can take a variable number of parameter specifiers. Most of these use spaces (e.g. -addrecipient ) to separate the parameter specifiers; some use commas (e.g. -dsnservers ). Such exceptions will be pointed out for each parameter to which they apply.

Additive Behavior

In general, parameters with similar function act additively.

For example, -bcc specifies directly on the command line one or more email addresses to be Blind Carbon Copied on the email, while -bcclist specifies this list indirectly (by pointing to a file that contains the list). If both parameters are used, then the total list of "Bcc:" recipients will be combination of those specified with -bcc and -bcclist .

Similarly, -addrecipient adds additional email addresses to the "To:" field of an outgoing email over and above what is originally specified with -to .

There is an exception: use of the database connectivity functions with -dbuseaddressee set to "to" will override whatever email address(es) you have specified in the -to parameter.


Alphabetical List of Parameters

Alphabetical Listing

All of NetMailBot's parameters are listed below alphabetically. You can use this list for reference while you get to know their names.

A

-addrecipient (-ar)
-altbody (-ab)
-altbodyfile (-af)
-appendbad (-abad)
-appendgood (-agood)
-appendlog (-ad)
-appendsuspect (-suspect)
-attachment (-a)
-attachmentdir (-ai)
-attachmentlist (-al)

-attachsubfolders (-asf)
-authlogin (-al)
-authpassword (-ap)

B
-bcc (-bcc)
-bcclist (-bl)
-body (-b)
-bodyfile (-bf)

C
-cc (-cc)
-ccfriendly (-cf)
-cclist (-cl)
-chars (-cpl)
-config (-c)
-connectiontimeout (-ct)
-customheader (-ch)

D

-dbconstants (-dbc)
-dbemailcolumn (-dbe)
-dbusecolumnindex (-dbi)
-dbreplacementids (-dbr)
-dbquery (-dbq)
-dbtable (-dbt)

-dbupdatequery (-dbuq)
-dbuseaddressee (-dbu)
-debug (-db)

-delimeter (-dm)
-dnsservers (-dnss)
-dsn (-dsn)

E
-embed (-em)

F

-failnoattach (-fna)
-failsafe (-sf)
-filedatebefore (-fdb)
-filedateafter (-fda)
-filedateis (-fdi)
-filemask (-fm)
-filesizelessthan (-fsl)
-filesizegreaterthan (-fsg)
-filesizeequal (-fse)

-findmailserver (-fms)
-from (-f)
-fromfriendly (-ff)

G
-generaltimeout (-gt)

H
-htmlbody (-html)

I

J

K

L
-logbademail (-lb)
-logfile (-logfile)
-loggoodemail (-lg)
-logsuspectemail (-gt)

M
-mimetype (-mt)

N
-nofixhtml (-nfh)

O

P
-personalize (-pl)

-popcleanup (-popc)
-popdelete (-popd)
-popdirectory (-pd)

-popdirectoryattachment (-pda)

-popdirectoryheader (-pdh)

-popdirectorymessage (-pdm)

-popdirectorysubfrom (-psdf)

-popdirectorysubto (-psdt)
-popforward (-popf)

-popforwardfromoriginator (-popfr)

-popforwardoriginator (-popfo)
-popheader (-poph)
-poppassword (-pp)
-popreceive (-popr)
-popreply (-pre)
-popserver (-ps)
-popstatistics (-pops)
-popuser (-pu)
-popwatch (-pw)
-popwatchexit (-pwe)
-popwatchwait (-pww)
-port (-port)
-preview (-pw)
-priority (-pr)

Q
-q (-q)

R
-receipt (-rr)
-receiptfriendly (-rf)
-receive (-r)
-recipientlimit (-rl)
-reconnectaftersend (-ra)

S
-sendwait (-sw)
-server (-s)
-subject (-sj)

T
-test (-test)
-to (-t)
-tofriendly (-tf)
-tolist (-tl)

U

V
-verify (-v)

W
-watchdir (-wd)
-watchdelete (-wde)
-watchexit (-we)

-watchfilenameisbody (-wfib)

-watchfilenameissubject (-wfis)

-watchfilenameisto (-wfit)
-watchmoveto (-wm)

-watchone (-wo)
-watchwait (-ww)

X

Y

Z
-zip (-zi)


Parameters Grouped by Category

Addressing

-addrecipient (-ar)

-bcc (-bcc)
-bcclist (-bl)

-cc (-cc)
-ccfriendly (-cf)
-cclist (-cl)

-delimeter (-dm)

-from (-f)
-fromfriendly (-ff)

-receipt (-rr)
-receiptfriendly (-rf)

-recipientlimit (-rl)

-to (-t)
-tofriendly (-tf)
-tolist (-tl)

Attachments

-attachment (-a)
-attachmentdir (-ai)
-attachmentlist (-al)

-attachsubfolders (-asf)

-failnoattach (-fna)

-filedatebefore (-fdb)
-filedateafter (-fda)
-filedateis (-fdi)
-filemask (-fm)
-filesizelessthan (-fsl)
-filesizegreaterthan (-fsg)
-filesizeequal (-fse)

-watchdir (-wd)
-watchdelete (-wde)
-watchexit (-we)

-watchfilenameisbody (-wfib)

-watchfilenameissubject (-wfis)

-watchfilenameisto (-wfit)
-watchmoveto (-wm)

-watchone (-wo)
-watchwait (-ww)
-zip (-zi)

Configuration

-config (-c)

Database Connectivity

-dbconstants (-dbc)

-dbemailcolumn (-dbe)
-dbusecolumnindex (-dbi)
-dbreplacementids (-dbr)
-dbquery (-dbq)
-dbtable (-dbt)

-dbupdatequery (-dbuq)
-dbuseaddressee (-dbu)

-dsn (-dsn)

External Integration

-q (-q)

-loadurl

Mail Merge

-personalize (-pl)

Message Content

-altbody (-ab)

-altbodyfile (-af)

-body (-b)
-bodyfile (-bf)

-chars (-cpl)

-customheader (-ch)

-embed (-em)

-htmlbody (-html)

-mimetype (-mt)
-nofixhtml (-nfh)

-preview (-pw)

-priority (-pr)

-subject (-sj)

POP Email Reception

-popcleanup (-popc)
-popdelete (-popd)
-popdirectory (-pd)

-popdirectoryattachment (-pda)

-popdirectoryheader (-pdh)

-popdirectorymessage (-pdm)

-popdirectorysubfrom (-psdf)

-popdirectorysubto (-psdt)
-popforward (-popf)

-popforwardfromoriginator (-popfr)

-popforwardoriginator (-popfo)
-popheader (-poph)
-poppassword (-pp)
-popreceive (-popr)
-popreply (-pre)
-popserver (-ps)
-popstatistics (-pops)
-popuser (-pu)
-popwatch (-pw)
-popwatchexit (-pwe)
-popwatchwait (-pww)

-receive (-r)

SMTP Server Communication

-appendsuspect (-suspect)

-authlogin (-al)
-authpassword (-ap)

-connectiontimeout (-ct)

-dnsservers (-dnss)

-failsafe (-sf)

-generaltimeout (-gt)

-logbademail (-lb)

-loggoodemail (-lg)
-logsuspectemail (-gt)

-port (-port)

-reconnectaftersend (-ra)
-sendwait (-sw)
-server (-s)

-verify (-v)

Troubleshooting

-appendbad (-abad)
-appendgood (-agood)

-appendlog (-ad)

-debug (-db)

-findmailserver (-fms)

-logfile (-logfile)

-test (-test)


-addrecipient (-ar)

Category:

Addressing

Description:

Adds recipient(s) to the list specified by -to. To add multiple email addresses, separate them with spaces.

-addrecipient is a deprecated parameter; you can accomplish the same thing by adding more email addresses to the -to parameter. See -to for details.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-addrecipient <email address1> <email address2> [...]

Example (cut-and-paste right into your batch file):

NetMailBot -addrecipient myname@email.com another@domain.com -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

The "To:" field of the mail sent in this example will contain email@domain.com, myname@email.com, and another@domain.com.

Comments:

None.


-altbody (-ab)

Category:

Message Content

Description:

Alternate text to display in email programs that do not support/display HTML messages.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-altbodyfile -body -bodyfile

Usage:

-altbody "<single-line plain text message>"

As indicated, the message cannot have any newlines ("return" characters).

Example (cut-and-paste right into your batch file):

NetMailBot -altbody "Since your email program cannot display HTML, we have provided this plain text message" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

If you were to use them both at the same time, -altbody and -altbodyfile would behave additively.


-altbodyfile (-af)

Category:

Message Content

Description:

Filename of file to be used as alternate text to display in email programs that do not support/display HTML messages.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-altbody -body -bodyfile

Usage:

-altbodyfile "<filename>"

The filename is that of a plain text message file (which, of course, may contain newlines, thus you can use this to specify more substantial plain text alternative message bodies).

Example (cut-and-paste right into your batch file):

NetMailBot -altbodyfile "C:\My Documents\plain_text_newsletter.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

If you were to use them both at the same time, -altbody and -altbodyfile would behave additively.


-appendbad (-abad)

Category:

Troubleshooting

Description:

Appends the bad email file if it already exists.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server -logbademail

See Also:

None.

Usage:

-appendbad

Example (cut-and-paste right into your batch file):

NetMailBot -logbademail "c:\temp\Bad Email List.txt" -appendbad -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-appendgood (-agood)

Category:

Troubleshooting

Description:

Appends the good email file if it already exists.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server -loggoodemail

See Also:

None.

Usage:

-appendgood

Example (cut-and-paste right into your batch file):

NetMailBot -loggoodemail "c:\temp\Good Email List.txt" -appendgood -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-appendlog (-ad)

Category:

Troubleshooting

Description:

Appends the log file if it already exists.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server -logfile

See Also:

None.

Usage:

-appendlog

Example (cut-and-paste right into your batch file):

NetMailBot -logfile "c:\temp\logfile.txt" -appendlog -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-appendsuspect (-suspect)

Category:

SMTP Server Communication

Description:

If specified, the suspect email file will be appended to.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server -logsuspectemail

See Also:

None.

Usage:

-appendsuspect

Example (cut-and-paste right into your batch file):

NetMailBot -logsuspectemail "c:\temp\Suspect Email List.txt" -appendsuspect -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-attachment (-a)

Category:

Attachments

Description:

Filename(s) of the attachment(s) you wish to send with the email message.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-attachmentlist

Usage:

-attachment "<filename1>" "<filename2>" [...]

Example (cut-and-paste right into your batch file):

NetMailBot -attachment "c:\temp\documents.zip" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

The parameters -attachment, -attachmentlist , and -attachmentdir all act additively when used in combination, they do not override each other.


-attachmentdir (-ai)

Category:

Attachments

Description:

Specifies a directory to add attachments from.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -attachsubfolders

See Also:

-filemask -zip

Usage:

-attachmentdir "<path to selected dir>"

Example (cut-and-paste right into your batch file):

NetMailBot -attachmentdir "C:\Documents and Settings\Invoices" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Use with -zip to compress files into one zip file and attach. Use with -filemask to specify only certain files, e.g. "*.txt".

The parameters -attachment , -attachmentlist , and -attachmentdir all act additively when used in combination, they do not override each other.


-attachmentlist (-atl)

Category:

Attachments

Description:

The pathname to the file containing the attachment list. The file should contain a comma-delimited list of attachment filenames.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -attachsubfolders

See Also:

-attachment

Usage:

-attachmentlist "<path to attachment filenames list file>"

Example (cut-and-paste right into your batch file):

NetMailBot -attachmentlist "c:\temp\attachment.lst" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

We suggest the extension ".lst" to distinguish your attachment list filename file, as used above in our example.

The parameters -attachment , -attachmentlist, and -attachmentdir all act additively when used in combination, they do not override each other.


-attachsubfolders (-asf)

Category:

Attachments

Description:

Causes files within sub-folders to be included when used in conjunction with other attachment parameters that cover whole directories including watch directory features.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-attachmentdir -attachmentlist -watchdir

Usage:

-attachsubfolders

Example (cut-and-paste right into your batch file):

NetMailBot -attachment "c:\temp\documents.zip" -attachsubfolders -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-authlogin (-al)

Category:

SMTP Server Communication

Description:

Sets the SMTP server authentication login id. Some SMTP servers require login before sending email.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -authpassword

See Also:

None.

Usage:

-authlogin <userid>

Example (cut-and-paste right into your batch file):

NetMailBot -authlogin userid -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-authpassword (-ap)

Category:

SMTP Server Communication

Description:

Sets the SMTP server authentication password. Some SMTP servers require login before sending email.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -authlogin

See Also:

None.

Usage:

-authpassword <user password>

Example (cut-and-paste right into your batch file):

NetMailBot -authpassword password123 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-bcc (-bcc)

Category:

Addressing

Description:

Email address(es) of Blind Carbon Copy ("BCC:") recipient(s).

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-bcclist

Usage:

-bcc <email address1> <email address2> [...]

Example (cut-and-paste right into your batch file):

NetMailBot -bcc bcc@mail.com -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

-bcc and -bcclist act together additively.


-bcclist (-bl)

Category:

Addressing

Description:

The filename of "Bcc:" address list file. The file should contain a comma-delimited list of email addresses.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-delimeter -bcc

Usage:

-bcclist <bcc list filename>

Example (cut-and-paste right into your batch file):

NetMailBot -bcclist "c:\temp\maillist.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

-bcc and -bcclist act together additively.


-body (-b)

Category:

Message Content

Description:

Plain text body of the message (enclose multiple words in quotes).

Optional?

Yes.

Overrides:

None.

Overridden By:

-bodyfile (when -bodyfile points to an HTML file on a website)

Other Parameters Required:

-to -from -server

See Also:

-bodyfile -htmlbody

Usage:

-body "<single line plain text>"

Example (cut-and-paste right into your batch file):

NetMailBot -body "This is the body of the email. Use this parameter for short messages. Make sure to enclose multiple words with spaces in quotes." -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

The intention is to use either -body or -bodyfile . However, -body acts additively with -bodyfile , so you could use both together, but the contents of the specified body file will be appended to whatever is specified in -body. Suppose the two parameters are used together in a NetMailBot invocation as:

... -body "Here is an inline message body" -bodyfile "C:\bodyfile.txt" ...

Suppose the content of bodyfile.txt is simply "One line in a bodyfile". Then the message will be received with the following body:

"Here is an inline message bodyOne line in a bodyfile"

However, this does not apply if -bodyfile references an HTML file on a website ( -bodyfile "http://www.something.com"). In this case, only the HTML file will be included as the message body.

If -bodyfile refers to a locally stored HTML file, the body will consist of the text from -body followed by the HTML file, but the results may appear strange.

Therefore, we recommend using -body or -bodyfile , but not both at the same time.


-bodyfile (-bf)

Category:

Message Content

Description:

Filename of file to be used as the body of the message.

Optional?

Yes.

Overrides:

-body (when -bodyfile points to an HTML file on a website)

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-body

Usage:

-bodyfile "<path to body file>"

Examples (cut-and-paste right into your batch file):

Example #1: The file C:\tmp\text.txt is loaded as the body of the email. The message body will appear as plain text due to the file extension .txt.

NetMailBot -bodyfile "C:\tmp\text.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Example #2: The file C:\tmp\rich.html is loaded as the body of the email. The message body will appear as HTML due to the file extension .html.

NetMailBot -bodyfile "C:\tmp\rich.html" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Example #3: The website http://www.ExclamationSoft.com is loaded as the body of the email and will appear as HTML in the recipient's email client.

NetMailBot -bodyfile "http://www.ExclamationSoft.com" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

The intention is to use either -body or -bodyfile. However, -body acts additively with -bodyfile, so you could use both together, but the contents of the specified body file will be appended to whatever is specified in -body . Suppose the two parameters are used together in a NetMailBot invocation as:

... -body "Here is an inline message body" -bodyfile "C:\bodyfile.txt" ...

Suppose the content of bodyfile.txt is simply "One line in a bodyfile". Then the message will be received with the following body:

"Here is an inline message bodyOne line in a bodyfile"

However, this does not apply if -bodyfile references an HTML file on a website (-bodyfile "http://www.something.com"). In this case, only the HTML file will be included as the message body.

If -bodyfile refers to a locally stored HTML file, the body will consist of the text from -body followed by the HTML file, but the results may appear strange.

Therefore, we recommend using -body or -bodyfile, but not both at the same time.


-cc (-cc)

Category:

Addressing

Description:

Email address of Carbon Copy recipient.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-cclist -ccfriendly

Usage:

-cc <email address1> <email address2> [...]

Example (cut-and-paste right into your batch file):

NetMailBot -cc cc@mail.com -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

-cc and -cclist act together additively.


-ccfriendly (-cf)

Category:

Addressing

Description:

Friendly name to display instead of "CC:" email address.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -cc

See Also:

None.

Usage:

-ccfriendly "<friendly name text>"

Example (cut-and-paste right into your batch file):

NetMailBot -ccfriendly "George Harrison" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

In the absence of this parameter, some email clients show "" (literally, two double-quotes) where the friendly name should be:

From: "" <zm45@mycompany.com>


-cclist (-cl)

Category:

Addressing

Description:

Full filename of "CC:" address list. This file should contain a comma-delimited list of email addresses.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-delimiter -cc

Usage:

-cclist "<cc list file>"

Example (cut-and-paste right into your batch file):

NetMailBot -cclist "c:\temp\maillist.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

-cc and -cclist act together additively.


-chars (-cpl)

Category:

Message Content

Description:

Characters per line. Specifies the maximum number of characters per line a message part should be. If plain text message parts appear incorrect - wrapping unintentionally - when viewing in an email client program, e.g., Outlook, set this value to 9999999. The default value is 72.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-chars <integer value>

Example (cut-and-paste right into your batch file):

NetMailBot -chars 9999999 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-config (-c)

Category:

Configuration

Description:

Specifies a configuration file from which to load commonly used parameters.

NetMailBot will load parameters from the command line/batch file first, then load parameters from the configuration file.

Parameters in the configuration file do not override, but add-to, the parameters specified on the command line or in a batch file.

As with batch files, all parameters cannot be separated by a carraige return.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server (if your config file contains these parameters, then your batch file does not need them as well)

See Also:

None.

Usage:

-config "<config file>"

Example (cut-and-paste right into your batch file):

NetMailBot -config c:\temp\config.txt -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-connectiontimeout (-ct)

Category:

SMTP Server Communication

Description:

Sets the connection timeout in milliseconds.

If the connection to the SMTP mail server takes longer than the specified time, NetMailBot will stop and return an %ERRORLEVEL% of 13. Use the parameter -failsafe to prevent NetMailBot from exiting and to retry indefinitely. For example, if -connectiontimeout is set to 5000 ms (5s), and the connection attempt times out, then use of -failsafe will cause NetMailBot to attempt the connection again without exiting with an %ERRORLEVEL% of 13.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-generaltimeout -failsafe

Usage:

-connectiontimeout <integer number of milliseconds>

Example (cut-and-paste right into your batch file):

NetMailBot -connectiontimeout 60000 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-customheader (-ch)

Category:

Message Content

Description:

Allows the adding of one or more strings to the header of the email. Separate multiple values with a semicolon.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-customheader "<plain text custom header line>

Example (cut-and-paste right into your batch file):

NetMailBot -customheader "Reply-To: email@domain.com;Return-Path:email@domain.com" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbconstants (-dbc)

Category:

Mail Merge

Description:

Acts much like -dbreplacementids except the defined tokens are replaced by the constants specified.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbquery -dbtable -dbuseaddressee -dsn -personalize -dbreplacementids -dbupdatequery

Usage:

-dbconstants "<delimiter><first id name><delimiter>=<first column name>, <delimiter><second id name><delimiter>=<second column name> [...]"

Specify replacement ids wrapped with delimiters such as << and >> so for example an id "first_name" would appear as <<first_name>>. Each id is followed by an equals sign, then the name of the corresponding column name. Separate multiple replacement identifiers with a comma.

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email" -dbconstants "<<first_name>>=first_name" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Can be used in conjunction with -dbreplacementids.


-dbemailcolumn (-dbe)

Category:

Database Connectivity

Description:

In the database query specified with -dbquery , -dbemailcolumn selects the table column in the database that contains the email addresses.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbusecolumnindex -dbreplacementids -dbquery -dbtable -dbuseaddressee -dsn -dbupdatequery -dbconstants

Usage:

-dbemailcolumn "<column name>"

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "EmailAddress" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

If -dbuseaddressee is omitted, as in this example, the addressing of the email addresses taken from the database with -dbemailcolumn will default to "to".


-dbusecolumnindex (-dbi)

Category:

Database Connectivity

Description:

Specifies that a column index is used in place of a column name, e.g., -dbreplacementids "<<first_name>>=2,<<last_name>>=1,<<company>>=3".Some databases do not handle column names well, so as an alternative, you can select columns by number.

Applies to -dbreplacementids and -dbemailcolumn . The example below shows both cases.

If your replacements are not working, try using -dbusecolumnindex.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbreplacementids -dbquery -dbtable -dbuseaddressee -dsn -dbupdatequery -dbconstants

Usage:

-dbusecolumnindex

Example (cut-and-paste right into your batch file):

NetMailBot -dbusecolumnindex -dbemailcolumn "0" -dbreplacementids "$first_name$=1" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbreplacementids (-dbr)

Category:

Mail Merge

Description:

Specifies replacement identifiers used with -personalize .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbquery -dbtable -dbuseaddressee -dsn -personalize -dbconstants -dbupdatequery

Usage:

-dbreplacementids "<delimiter><first id name><delimiter>=<first column name>, <delimiter><second id name><delimiter>=<second column name> [...]"

Specify replacement ids wrapped with delimiters such as << and >> so for example an id "first_name" would appear as <<first_name>>. Each id is followed by an equals sign, then the name of the corresponding column name. Separate multiple replacement identifiers with a comma.

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email"-dbreplacementids "<<first_name>>=first_name" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbquery (-dbq)

Category:

Database Connectivity

Description:

Specifies the SQL query for NetMailBot to execute when using the database and mail merge commands.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbreplacementids -dbtable -dbuseaddressee -dsn -dbupdatequery -dbconstants

Usage:

-dbquery "<SQL query string>"

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbtable (-dbt)

Category:

Database Connectivity

Description:

Sets the database table to use when using -personalize .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbreplacementids -dbquery -dbuseaddressee -dsn -dbupdatequery -dbconstants

Usage:

-dbtable "<table name>"

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbtable "customer" -dbemailcolumn "email" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbupdatequery (-dbuq)

Category:

Database Connectivity

Description:

Performs a database query after an email is sent in non-TEST mode. The query itself can contain database replacement ids as specified in -dbreplacementids or -dbconstants .

Optional?

Yes.

Overrides:

None.

Overridden By:

-test

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbreplacementids -dbtable -dbuseaddressee -dsn -dbconstants

Usage:

-dbupdatequery "<SQL query string>"

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbupdatequery "UPDATE tableName SET flag=1 WHERE email=$email$" -dbemailcolumn "email" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-dbuseaddressee (-dbu)

Category:

Database Connectivity

Description:

Specifies which addressee ("To:", "CC:", or "BCC:") should be used for the email addresses to be taken from the database, for either uniform mass-mailings or mail merges with -personalize .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to (required if -dbuseaddressee is NOT "to") -from -server

See Also:

-dbemailcolumn -dbusecolumnindex -dbreplacementids -dbquery -dbtable -dsn -dbupdatequery -dbconstants

Usage:

-dbuseaddressee "<addressee type>"

<addressee type> is one of to, bcc, or cc. See the example below.

Example (cut-and-paste right into your batch file):

NetMailBot -dsn "mydb" -dbquery "SELECT * FROM Customers" -dbemailcolumn "email"-dbuseaddressee "to" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Use of -dbuseaddressee is additive with respect to the other addressing parameters for "To:" ( -to ), "Cc:" ( -cc ), and "Bcc:" ( -bcc ). Thus, if you choose -dbuseaddresee "to", then the email addresses fetched from the database column will add to any email addresses specified inline with -to .


-debug (-db)

Category:

Troubleshooting

Description:

Turns on debug mode. Debug mode logs messages to and from the mail server. Use this option to determine if there is a problem with the mail server.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-test

Usage:

-debug

Example (cut-and-paste right into your batch file):

NetMailBot -debug -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Use with -test to do preliminary test runs to make sure that the communication with the SMTP server goes smoothly.


-delimiter (-dm)

Category:

Addressing

Description:

Used with -tolist , -cclist , -bcclist , -loggoodemail , -logbademail , and -logsuspectemail. Defines the character used to separate email addresses in the email lists. The delimiter is automatically detected with -tolist , -cclist , and -bcclist . Use this parameter to override this.

NOTE: Using -delimiter, the delimiter must be the same in both the list files referred to by -tolist , -cclist , and -bcclist and in the log files generated by NetMailBot.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-tolist -cclist -bcclist

Usage:

-delimiter "<one or more characters>"

Example (cut-and-paste right into your batch file):

NetMailBot -logbademail "c:\temp\Bad Email List.txt" -appendbad -delimiter ";" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Control characters cannot be used in the -delimiter.


-dnsservers (-dnss)

Category:

SMTP Server Communication

Description:

Specifies one or more DNS servers used for email address verification. If this property is not specified, then NetMailBot will search the registry for addresses.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-verify

See Also:

None.

Usage:

-dnsservers <list of DNS IP addresses>

Example (cut-and-paste right into your batch file):

NetMailBot -verify email@domain.com -from email@domain.com -dnsservers 192.168.0.1

Separate multiple server addresses with a comma.

Comments:

NOTE: Email address verification is maintained in NetMailBot for backward compatibility with older versions, but is no longer a supported feature.


-dsn (-dsn)

Category:

Database Connectivity

Description:

Specifies a Data Source Name (DSN) that is used to import email addresses from a database. A data source name is created by using the ODBC manager in the Windows Control Panel. Alternately, you can specify ODBC driver parameters directly (see examples).

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

Getting addresses from the database: -dbemailcolumn -dbusecolumnindex -dbquery -dbuseaddressee -dbtable

Personalizing the generated email messages: -dbreplacementids -personalize -dbconstants

Other: -dbupdatequery

Usage:

-dsn "<DSN name>"

or

-dsn "<ODBC driver parameters>"

Examples (cut-and-paste right into your batch file):

Example #1: To Import a Microsoft Access Database with direct specification of ODBC driver parameters:

NetMailBot -dsn "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\temp\dsn\MyAccessDatabase.mdb" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Example #2: To Import a Microsoft Excel Spreadsheet with direct specification of ODBC driver parameters:

NetMailBot -dsn "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\temp\dsn\MyExcelSpreadsheet.xls; Extended Properties=Excel 8.0;" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Example #3: To Import using a DSN (the DSN was set up via the ODBC Manager):

NetMailBot -dsn "MyDatabase" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

See the How to Set Up a DSN topic for more on DSNs.


-embed (-em)

Category:

Message Content

Description:

Embeds images into email when sending an HTML email body, as opposed to the images being loaded into the HTML via links to image file stored elsewhere. Supported file types are .jpg and .gif.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -bodyfile

See Also:

None.

Usage:

-embed

Example (cut-and-paste right into your batch file):

NetMailBot -embed -bodyfile "http://www.yahoo.com" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-failnoattach (-fna)

Category:

Attachments

Description:

When specified, NetMailBot will fail and stop processing if an attachment specified with -attachment does not exist. By default, NetMailBot fails and stops processing when a specified attachment does not exist.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-attachment

Usage:

-failnoattach

Example (cut-and-paste right into your batch file):

NetMailBot -attachment "c:\temp\documents.zip" -failnoattach -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None


-failsafe (-sf)

Category:

SMTP Server Communication

Description:

When specified, NetMailBot will not stop when an error condition is reported, such as a connection timeout, a general timeout, and an unexpected disconnection from the mail server.

NOTE: Use this parameter with caution: NetMailBot will continuously try to reconnect and send email indefinitely until all messages are successfully sent or received.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-connectiontimeout -generaltimeout

Usage:

-failsafe

Example (cut-and-paste right into your batch file):

NetMailBot -failsafe -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filedatebefore (-fdb)

Category:

Attachments

Description:

Only attach files if date is before specified date.

Optional?

Yes.

Overrides:

None.

Overridden By:

-filedateafter -filedateis

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filedateafter -filedateis

Usage:

-filedatebefore "<date>"

Example (cut-and-paste right into your batch file):

NetMailBot -filedatebefore "6/1/2003" -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filedateafter (-fda)

Category:

Attachments

Description:

Only attach files if date is after the specified date.

Optional?

Yes.

Overrides:

-filedatebefore -filedateis

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filedatebefore -filedateis

Usage:

-filedateafter "<date>"

Example (cut-and-paste right into your batch file):

NetMailBot -filedateafter "6/1/2003" -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filedateis (-fdi)

Category:

Attachments

Description:

Only attach files if date is the specified date.

Optional?

Yes.

Overrides:

-filedatebefore

Overridden By:

-filedateafter

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filedatebefore -filedateafter

Usage:

-filedateis "<date>"

Example (cut-and-paste right into your batch file):

NetMailBot -filedateis "6/1/2003" -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filemask (-fm)

Category:

Attachments

Description:

Specifies a file mask, e.g. *.*, SYS*.TXT, OS*.TXT. Separate multiple filemasks with a comma.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

None.

Usage:

-filemask "<filemask>"

By default, the mask is *.* - all files. -filemask works with the following DOS wildcards:

"*" matches one or more of any characters

"?" matches one or zero of any character

Thus, "*.txt" finds any file whose extension is ".txt"; "Rep*.txt" finds all .txt files whose names start with "Rep"; "Rep?.*" finds all files of any extension that have "Rep" as the first three letters of their names plus perhaps one other character, e.g. "Rep6.doc".

Example (cut-and-paste right into your batch file):

NetMailBot -filemask "*.txt" -attachmentdir "c:\Documents and settings\docs" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

(The following will look for any file ending with .txt, .doc, and .xls)

NetMailBot -filemask "*.txt,*.doc,*.xls" -attachmentdir "c:\Documents and settings\docs" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

The filemasks * and ? only work with the -filemask parameter.


-filesizelessthan (-fsl)

Category:

Attachments

Description:

Only attach files if size is less than number in bytes specified.

Optional?

Yes.

Overrides:

None.

Overridden By:

-filesizegreaterthan -filesizeequal

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filesizegreaterthan -filesizeequal

Usage:

-filesizelessthan <integer size value in bytes>

Example (cut-and-paste right into your batch file):

NetMailBot -filesizelessthan 10000 -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filesizegreaterthan (-fsg)

Category:

Attachments

Description:

Only attach files if size is greater than number in bytes specified.

Optional?

Yes.

Overrides:

-filesizelessthan -filesizeequal

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filesizelessthan -filesizeequal

Usage:

-filesizegreaterthan <integer size value in bytes>

Example (cut-and-paste right into your batch file):

NetMailBot -filesizegreaterthan 10000 -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-filesizeequal (-fse)

Category:

Attachments

Description:

Only attach files if size is equal to the number in bytes specified.

Optional?

Yes.

Overrides:

-filesizelessthan

Overridden By:

-filesizegreaterthan

Other Parameters Required:

-to -from -server ( -attachmentdir or -watchdir )

See Also:

-filesizelessthan -filesizegreaterthan

Usage:

-filesizeequal <integer size value in bytes>

Example (cut-and-paste right into your batch file):

NetMailBot -filesizeequal 10000 -attachmentdir "c:\temp" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-findmailserver (-fms)

Category:

Troubleshooting

Description:

Finds and displays associated SMTP mail servers for the specified email address or domain name.

Optional?

Yes.

Overrides:

None.

Overridden By:

None

Other Parameters Required:

None

See Also:

None

Usage:

-findmailserver "email@domain.com"

Example (cut-and-paste right into your batch file):

NetMailBot -findmailserver "email@domain.com"

NetMailBot -findmailserver "domain.com"

Comments:

This parameter is useful for finding the name(s) of the mail server for a particular domain or email address.


-from (-f)

Category:

Addressing

Description:

"From:" email address, e.g. you@you.net.

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -server

See Also:

-fromfriendly

Usage:

-from "<from email address>"

Example (cut-and-paste right into your batch file):

NetMailBot -from you@hotmail.com -to email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-fromfriendly (-ff)

Category:

Addressing

Description:

"Friendly" name that appears in the email client. The "From:" field in an email client can display the email address (e.g. abc34@somecompany.com), an equivalent "friendly" name (e.g. "Bob Smith"), or both. Client behavior varies as to what exactly is displayed. Many clients display e.g.:

From: "<friendly>" <email address>

In others, if the "Friendly" address is present, the "normal" email address is not displayed.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-fromfriendly "<friendly name of sender>"

Example (cut-and-paste right into your batch file):

NetMailBot -fromfriendly "John Doe" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-generaltimeout (-gt)

Category:

SMTP Server Communication

Description:

Sets the general timeout while sending an individual message (in milliseconds).

If the process of sending the message, including attachments, exceeds the specified time, NetMailBot will stop and return an %ERRORLEVEL% of 13. Use the parameter -failsafe to prevent NetMailBot from exiting and to retry indefinitely. For example, if -generaltimeout is set to 60000 ms (1m), and the sending operation times out, then use of -failsafe will cause NetMailBot to attempt the connection again without exiting with an %ERRORLEVEL% of 13.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-connectiontimeout -failsafe

Usage:

-generaltimeout <integer timeout value in milliseconds>

Example (cut-and-paste right into your batch file):

NetMailBot -generaltimeout 600000 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-htmlbody (-html)

Category:

Message Content

Description:

If specified, the message body's MIME type is set to be TEXT/HTML. Use in conjunction with -body to force NetMailBot to override the default MIME type of TEXT/PLAIN.

This parameter essentially enables inline HTML. That is, the -body parameter is usually specified with plain text, but with -htmlbody you can put HTML tags in the -body parameter and the client will display it as HTML. See the example.

The alternative (and more common) option is to use -bodyfile to refer to an HTML file.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -bodyfile or -body )

See Also:

None.

Usage:

-htmlbody

Example (cut-and-paste right into your batch file):

NetMailBot -htmlbody -body "<h1>Use the -htmlbody parameter to force NetMailBot to set the MIME type for the message body to TEXT/HTML.</h1>" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

NetMailBot always does some basic detection of HTML message bodies in the -body parameter; if NetMailBot finds <html> or <body> within the -body parameter text, then it assumes that the content is to be interpreted and displayed as HTML.

If you are using simpler HTML tags, such as the heading tags in the above example, and do not include <html> or <body>, then using -htmlbody forces NetMailBot to interpret the content as HMTL.

The intention is to use either -body (possibly with -htmlbody as above) or -bodyfile , but not both at once (which would be unusual anyway). Using both at once may yield strange results.


-loadurl

Category:

Troubleshooting

Description:

Loads the specified URL through NetMailBot, and optionally save loaded HTML to a specified file.

Optional?

Yes.

Overrides:

None.

Overridden By:

None

Other Parameters Required:

None

See Also:

None

Usage:

-loadurl "<URL>" ["<path to bad address file>"]

Example (cut-and-paste right into your batch file):

NetMailBot -logbademail "http://www.exclamationsoft.com"

NetMailBot -logbademail "http://www.exclamationsoft.com" "c:\output.html"

Comments:

This parameter is useful for loading a URL and saving the output to a file. Additionally, this can trigger dial-up networking to connect to the Internet.


-logbademail (-lb)

Category:

SMTP Server Communication

Description:

Filename of file to capture all "bad" addresses - ones that are rejected by mail server.

NOTE: An existing bad email file is erased and overwritten unless you specify the -appendbad parameter.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server

See Also:

-appendbad

Usage:

-logbademail "<path to bad address file>"

Example (cut-and-paste right into your batch file):

NetMailBot -logbademail "c:\temp\Bad Email List.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-logfile (-logfile)

Category:

Troubleshooting

Description:

Filename of file to be used as the logfile.

NOTE: An existing log file is erased and overwritten unless you specify the -appendlog parameter.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server

See Also:

-appendlog

Usage:

-logfile "<path to logfile>"

Example (cut-and-paste right into your batch file):

NetMailBot -logfile "c:\temp\logfile.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-loggoodemail (-lg)

Category:

SMTP Server Communication

Description:

Filename of file to capture all "good" addresses - ones that are accepted by mail server.

NOTE: An existing good email file is erased and overwritten unless you specify the -appendgood parameter.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server

See Also:

-appendgood

Usage:

-loggoodemail "<path to good address file>"

Example (cut-and-paste right into your batch file):

NetMailBot -loggoodemail "c:\temp\Good Email List.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-logsuspectemail (-ls)

Category:

SMTP Server Communication

Description:

Specifies the pathname of the file to write suspect email addresses to. This parameter is only valid when used with the -verify parameter. Suspect email addresses are those that NetMailBot is unable to check for validity.

NOTE: An existing suspect email file is erased and overwritten unless you specify the -appenduspect parameter.

Optional?

Yes.

Overrides:

None.

Overridden By:

-nolog

Other Parameters Required:

-to -from -server

See Also:

-verify -appenduspect

Usage:

-logsuspectemail "<path to suspect email file>"

Example (cut-and-paste right into your batch file):

NetMailBot -logsuspectemail "c:\temp\suspect.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-mimetype (-mt)

Category:

Message Content

Description:

This overrides the automatically-set MIME content type of the message body. It does not affect any other part of the message. Examples: "text/plain" and "text/html".

This is a more advanced parameter. You can use this parameter in situations when you have some specially encoded content that you want to "inject" into the message sent by NetMailBot, and you want it to show up in the email client a certain way (i.e. as a certain mimetype), for example, "application/msword".

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -bodyfile or -body )

See Also:

-htmlbody

Usage:

-mimetype "<mime type specification>"

Example (cut-and-paste right into your batch file):

NetMailBot -mimetype "text/html" -body "plain text body" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Using -htmlbody is functionally equivalent to using -mimetype "text/html" as in the above example.


-nofixhtml (-nfh)

Category:

Message Content

Description:

Prevents a bodyfile with HTML from being "fixed".The HTML file may contain links like "image/pic1.gif". By default, NetMailBot automatically "fixes" these by changing them to be fully qualified paths, e.g. "http://www.domain.com/image/pic1.gif", so that the images and links do not appear broken in the mail client software.

Specify this switch to prevent the "fix".

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -bodyfile or -body )

See Also:

None.

Usage:

-nofixhtml

Example (cut-and-paste right into your batch file):

NetMailBot -nofixhtml -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" -bodyfile http://www.domain.com/page.html

Comments:

None.


-nolog (-nl)

Category:

SMTP Server Communication

Description:

-nolog prevents a logfile from being created, that is, it turns off logging.

Optional?

Yes.

Overrides:

-logsuspectemail -appendsuspect -logbademail -appendbad -loggoodemail -appendgood -logfile -appendlog

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-nolog

Example (cut-and-paste right into your batch file):

NetMailBot -nolog -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" -body "No log this time!"

Comments:

None.


-personalize (-pl)

Category:

Mail Merge

Description:

Turns on personalization or what is more commonly known as "mail merge". This allows the merging of data from an outside source, like a database, into your email message or parts of that message.

Message fields that can be personalized are:

  • -altbody
  • -body
  • -bodyfile
  • -subject
  • -tofriendly
  • -ccfriendly
  • -from
  • -fromfriendly

Refer to the examples on mail merge here .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -dsn -dbemailcolumn -dbreplacementids -dbuseaddressee ( -dbtable | -dbquery )

See Also:

None.

Usage:

-personalize

Example (cut-and-paste right into your batch file):

NetMailBot -personalize -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-port (-port)

Category:

SMTP Server Communication

Description:

SMTP server port number. Default = 25 (Unless you have a specific reason for changing the port number, it is not recommended that you set this parameter.)

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-port <TCP/IP portnumber>

Example (cut-and-paste right into your batch file):

NetMailBot -port 8383 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-preview (-pv)

Category:

Troubleshooting

Description:

Turns on preview mode of an HTML message body. A Internet browser window will open displaying the message body.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-from -server ( -bodyfile or -body )

See Also:

None.

Usage:

-preview

Example (cut-and-paste right into your batch file):

NetMailBot -preview -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" -bodyfile "http://www.exclamationsoft.com"

Comments:

Use -preview in setting up your email transmissions to test the appearance of HTML message bodies.


-priority (-pr)

Category:

Message Content

Description:

Sets the Microsoft Mail message priority. Valid settings for this parameter: LOW, NORMAL, HIGH.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-priority <priority value>

<priority value> is either high, normal, or low.

Example (cut-and-paste right into your batch file):

NetMailBot -priority low -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Some email clients do not recognize priority, so this setting would have no effect at those clients.


-popcleanup (-popc)

Category:

POP Email Reception

Description:

Switch used to force all files in the -popdirectory to be deleted before processing. This is useful to keep the -popdirectory from growing too large

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

None.

Usage:

-popcleanup

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popcleanup -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdelete (-popd)

Category:

POP Email Reception

Description:

Specifies a message to delete. Specify a message index number after this parameter to delete a single message. If you do not specifiy a message number, all messages will be deleted.

Messages are numbered in the POP account according to the order of their arrival starting with 1. This numbering is dynamic between email deletions. An example:

Suppose emails arrived in the POP account from the senders indicated, and in this order:

joe@somecompany.com (arrived 8:15 AM; message #1)

suzieq@bigcompany.com (arrived 9:00 AM; message #2)

bob@superco.com (arrived 11:15 AM; message #3)

Suppose you use NetMailBot to fetch the first message, forward it, then delete it. The new numbering is:

suzieq@bigcompany.com (arrived 9:00 AM; message #1)

bob@superco.com (arrived 11:15 AM; message #2)

Thus, from one connection to another, the index numbers refer to different messages. Keep this in mind to avoid confusion over what messages you intend to delete.

Can be used in conjunction with other POP3 commands. If used with other POP3 commands, deletion will only occur if there are no errors or problems with the other commands.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

None.

Usage:

-popdelete <message number>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdelete 1 -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectory (-pd)

Category:

POP Email Reception

Description:

Specifies the directory name to save retrieved attachments, email message bodies, and other MIME parts. If not specified, then a directory named "pop" is created and used under the system temporary directory .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

-popcleanup -popdirectorysubfrom -popdirectorysubto -popdirectoryattachment -popdirectoryheader -popdirectorymessage

Usage:

-popdirectory "<path to selected dir>"

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectoryattachment (-pda)

Category:

POP Email Reception

Description:

When specified, received messages attachments are stored in the specified directory.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popdirectory

See Also:

None.

Usage:

-popdirectoryattachment

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popdirectoryattachment -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectoryheader (-pdh)

Category:

POP Email Reception

Description:

When specified, received message headers are stored in the specified directory.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popdirectory

See Also:

None.

Usage:

-popdirectoryheader

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popdirectoryheader -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectorymessage (-pdm)

Category:

POP Email Reception

Description:

When specified, received messages bodies are stored in the specified directory.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popdirectory

See Also:

None.

Usage:

-popdirectorymessage

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popdirectorymessage -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectorysubfrom (-psdf)

Category:

POP Email Reception

Description:

When specified, the -popdirectory for received messages is appended with the "from" email address. For example, if -popdirectory is "c:\temp\pop", then for each message received, a sub directory is created with the email address to store messages in, e.g. "c:\temp\pop\email@domain.com"

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popdirectory

See Also:

None.

Usage:

-popdirectorysubfrom

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popdirectorysubfrom -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popdirectorysubto (-psdt)

Category:

POP Email Reception

Description:

When specified, the -popdirectory for received messages is appended with the "to" email address. For example, if -popdirectory is "c:\temp\pop", then for each message received, a sub directory is created with the email address to store messages in, e.g. "c:\temp\pop\email@domain.com"

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popdirectory

See Also:

None.

Usage:

-popdirectorysubto

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popdirectory "c:\temp" -popdirectorysubto -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popforward (-popf)

Category:

POP Email Reception

Description:

Switch used to forward email to one or more email addresses. Can be used in combination with any of the other parameters that normally send email. Additionally specify the parameters -to and -from.

When the email is forwarded, NetMailBot uses the subject (with "FW: " appended to the beginning), the message body (or bodies for a mixed MIME message), and any attachments from the received email and forwards them in a new (forwarded) email.

If additonal parameters for sending are specified, they will override/overwrite any corresponding message part values in the email that was received. For example, if -subject is specified, the subject from the received email will not be used. See examples for more detail.

If there are no messages are on the server to download, no action is taken.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -receive -popuser -poppassword -popserver -server -popforwardorginator

See Also:

-popreceive

Usage:

-popforward

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popforward -to to@domain.com -from from@domain.com -server smtp.domain.com -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popforwardfromoriginator (-popfr)

Category:

POP Email Reception

Description:

Uses the -from email address the original "to" email address in the received email.

Optional?

Yes.

Overrides:

-to

Overridden By:

None.

Other Parameters Required:

-from -receive -popuser -poppassword -popserver -server

See Also:

-popforwardoriginator

Usage:

-popforwardfromoriginator

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popforward -popforwardfromoriginator -from from@domain.com -server smtp.domain.com -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popforwardoriginator (-popfo)

Category:

POP Email Reception

Description:

Adds to the subject "Originated from: {from email address} Subject: {original subject}".

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -receive -popuser -poppassword -popserver -server

See Also:

-popforward -subject -popforwardfromoriginator

Usage:

-popforwardoriginator

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popforward -popforwardoriginator -to to@domain.com -from from@domain.com -server smtp.domain.com -popuser username -poppassword password -popserver pop.domain.com

Comments:

If -subject is included, it will become a part of the cumulative subject. For example -subject "this is a new subject", the final subject will be: "Originated from: {from email address} Subject: this is a new subject"


-popheader (-poph)

Category:

POP Email Reception

Description:

Specifies a header to retrieve. Specify a message number after this parameter for a single message header. If you do not specifiy a message number, all messages will be retrieved.

The text from the message header is saved in a file named "header[message number].txt" under a folder named "pop3" under your system temporary directory. To view these files, at a DOS command prompt, type "cd %TEMP%\pop3".

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

None.

Usage:

-popheader "<message number>"

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popheader 1 -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-poppassword (-pp)

Category:

POP Email Reception

Description:

Specifies the email account user password.

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -popserver

See Also:

None.

Usage:

-poppassword <password>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -poppassword password -popuser username -popserver pop.domain.com

Comments:

None.


-popreceive (-popr)

Category:

POP Email Reception

Description:

Specifies a message to retrieve. Each part of the email message, body and attachments, are saved to the hard drive. Specify a message number after this parameter for a single message. If you do not specifiy a message number, all messages will be retrieved.

See the explanation under -popdelete for details on message index numbering.

When an email message from your POP3 mail server is downloaded the message parts are saved in individual files in a folder named "pop3" under your system temporary directory . To view these files, at a DOS command prompt, type "cd %TEMP%\pop3".

Each email message normally will have at least one message part. The text message body part is saved as "text_plain[message number].txt". The HTML message body is saved as "text_html[message number].html". Attachments are saved with their original name. If any of the files exist, they are overwritten.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

None.

Usage:

-popreceive <message number>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popreceive 1 -popuser username -poppassword password -popserver pop.domain.com

Comments:

While -popreceive instructs NetMailBot to fetch a particular message, the -receive parameter is still required in order to actually "turn on" POP message reception. That is, -receive puts NetMailBot into "POP3 mode" as opposed to "SMTP mode" which is for sending emails.


-popreply (-pre)

Category:

POP Email Reception

Description:

Specifies a message to auto-reply to. Each part of the email message, body and attachments, are saved to the hard drive. Specify a message number after this parameter for a single message. If you do not specifiy a message number, all messages will be replied to.

You must specify either -body or -bodyfile and/or other sending parameters for the reply.

If -subject is not specified, then the original subject is used with the prefix "RE: "

Cannot be used with -popreceive or -popforward .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -receive -popuser -poppassword -popserver -server

See Also:

-popreceive

Usage:

-popreply "<message number>"

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popreply 1 -from email@domain.com -server smtp.domain.com -body "Thank you for your interest" -popuser username -poppassword password -popserver pop.domain.com

Comments:

See description above for restrictions and requirements for using this parameter.


-popserver (-ps)

Category:

POP Email Reception

Description:

Specifies the name of the POP3 mail server.

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword

See Also:

None.

Usage:

-popserver <pop server name>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popserver pop.domain.com -popuser username -poppassword password

Comments:

None.


-popstatistics (-pops)

Category:

POP Email Reception

Description:

Retrieves the number of messages and the total number of bytes the email messages are using for the specified email account.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

None.

Usage:

-popstatistics

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popstatistics -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popuser (-pu)

Category:

POP Email Reception

Description:

Specifies the POP email account user name.

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -poppassword -popserver

See Also:

None.

Usage:

-popuser <username>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popwatch (-pw)

Category:

POP Email Reception

Description:

Switch used to monitor an email account continuously and perform specific actions indefinitely. Adding -popwatchwait can set the period of time between NetMailBot's queries to the POP server. If you do not use -popwatchwait , NetMailBot continuously queries the POP server. Thus, we recommend using -popwatchwait and set the period to some reasonable wait time.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver

See Also:

-popreceive

Usage:

-popwatch

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popwatch -popreceive -podelete -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popwatchexit (-pwe)

Category:

POP Email Reception

Description:

Specifies that NetMailBot should exit a watch, after successfully retrieving at least one email message. Modifies the behavior of -popwatch to add this functionality.

Optional?

Yes.

Overrides:

-popwatchwait

Overridden By:

None.

Other Parameters Required:

-receive -popuser -poppassword -popserver -popwatch

See Also:

-popreceive

Usage:

-popwatchexit

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popwatchexit -popwatch -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-popwatchwait (-pww)

Category:

POP Email Reception

Description:

Specifies the number of milliseconds to wait between monitoring an email account for new messages.

Optional?

Yes.

Overrides:

None.

Overridden By:

-popwatchexit (NetMailBot will exit after retrieving at least one message instead of waiting the specified time period and checking again).

Other Parameters Required:

-receive -popuser -poppassword -popserver -popwatch

See Also:

-popreceive

Usage:

-popwatchwait <wait period in milliseconds>

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popwatchwait 5000 -popwatch -popuser username -poppassword password -popserver pop.domain.com

Comments:

None.


-q (-q)

Category:

Troubleshooting

Description:

Quiet mode. Specifies that NetMailBot should not display anything on the screen. Useful if integrating NetMailBot with your own program.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from ( -server or -receive or -popserver or -popuser or -poppassword or -popwatch )

See Also:

None.

Usage:

-q

Example (cut-and-paste right into your batch file):

NetMailBot -q -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-receipt (-rr)

Category:

Addressing

Description:

Sets the email address for the receiving email client to which to send a receipt that the email has been received.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-receiptfriendly

Usage:

-receipt <email address to send the receipt to>

Example (cut-and-paste right into your batch file):

NetMailBot -receipt email@domain.com -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

Not all email clients support sending receipts.


-receiptfriendly (-rf)

Category:

Addressing

Description:

Sets the friendly name for the -receipt parameter's specified email address.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -receipt

See Also:

None.

Usage:

-receipt "<receipt address friendly name>"

Example (cut-and-paste right into your batch file):

NetMailBot -receipt John.Doe@company.com -receiptfriendly "John Doe" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-receive (-r)

Category:

POP Email Reception

Description:

Instructs NetMailBot to receive email from a POP3 email server.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-popserver -popuser -poppassword

See Also:

None.

Usage:

-receive

Example (cut-and-paste right into your batch file):

NetMailBot -receive -popuser username -poppassword password -popserver pop.domain.com

Comments:

The -receive parameter is the actual trigger that "turns on" POP3 reception. The parameter -popreceive instructs NetMailBot to receive a particular message in the POP3 account Inbox.


-recipientlimit (-rl)

Category:

Addressing

Description:

Sets the number of recipients an outgoing message is sent to at one time. The default is 100, to which most SMTP servers set the limit.

For custom mass mailings to individuals: This option is particularly useful if you wish to send out a personalized, custom email to each person on your mailing list: by setting this parameter to 1, each individual will be the only addressee on the email.

For example, let's assume you have a database of 2000 emails. If you do not use -receiptlimit at all, and you do not use -dbuseaddressee or set it to "to", then the default value of 100 receipients will be used and what will actually be sent will be 20 emails, each to 100 of the email addresses in the database (the first email will be sent to the first 100, the second to the second 100, and so on).

If you set -receiptlimit to 1, however, then what will actually be sent will be 2000 emails, one to each address in the database. Each address will thus be the sole address in the "To:" field of the email it receives.

For the sake of completeness in this example, if you had 2050 email addresses in the database and used the first configuration discussed above, the twenty-first email would of course be sent to the last 50 addresses and 50 addresses would appear in that email's "To:" field.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-tolist -dsn ( -dbtable OR -dbquery ) -dbemailcolumn -dbreplacementids -dbuseaddressee -personalize

Usage:

-receiptlimit <max number of recipients per email>

Example (cut-and-paste right into your batch file):

NetMailBot -recipientlimit 1 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "Your Personal Report"

Comments:

None.


-reconnectaftersend (-ra)

Category:

SMTP Server Communication

Description:

Specifies that after sending a message to disconnect, then reconnect.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-failsafe -sendwait

Usage:

-reconnectaftersend

Example (cut-and-paste right into your batch file):

NetMailBot -reconnectaftersend -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

See this section for more on the use of this parameter.


-sendwait (-sw)

Category:

SMTP Server Communication

Description:

Sets the number of milliseconds to wait after sending a message. Useful for some mail servers that prevent message sending from causing a throughput overload.

If you are sending a large number of emails in one run (for example, a large mass-mailing with thousands or tens of thousands of emails to be sent) then you can use this parameter to "control the flow" - the SMTP server is given time to process each "chunk" of emails before the next one is sent to it.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-failsafe -reconnectaftersend

Usage:

-sendwait <inter-mailing delay integer value in milliseconds>

Example (cut-and-paste right into your batch file):

NetMailBot -sendwait 5000 -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

See the Controlling Throughput to the SMTP Server topic for more information on the use of this parameter.


-server (-s)

Category:

SMTP Server Communication

Description:

The name of the SMTP server via which you wish to send out emails, e.g. smtp.mail.com (NOTE: this example is not a real SMTP server name)

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from

See Also:

None.

Usage:

-server <SMTP server name>

Example (cut-and-paste right into your batch file):

NetMailBot -server mail.domain.com -to email@domain.com -from email@domain.com -subject "test"

Comments:

None.


-subject (-sj)

Category:

Message Content

Description:

The "Subject:" line of the outgoing email.

Optional?

No.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

None.

Usage:

-subject "<single line of subject text>"

Example (cut-and-paste right into your batch file):

NetMailBot -subject "This is the subject. Make sure you enclose multiple words in quotes" -to email@domain.com -from email@domain.com -server mail.domain.com

Comments:

None.


-test (-test)

Category:

Troubleshooting

Description:

Test mode. When this parameter is used, NetMailBot connects to the mail server and addresses your message(s) but does not actually send the message(s).

This is useful to ensure that all of the parameters you are using are correct. It can also alert you to possibly bad/invalid email addresses.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from ( -server or -receive -popserver -popuser -poppassword -popwatch )

See Also:

-debug

Usage:

-test

Example (cut-and-paste right into your batch file):

NetMailBot -test -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-to (-t)

Category:

Addressing

Description:

TO email address, e.g. no@no.net.

Specify multiple email addresses by placing a space between each email address.

NOTE: If the parameter -tolist is specified, this parameter is ignored.

Optional?

No.

Overrides:

None.

Overridden By:

-tolist -watchfilenameisto

Other Parameters Required:

-from -server

See Also:

-tolist -tofriendly -watchfilenameisto

Usage:

-to <first to email address> <second to email address> [...]

Example (cut-and-paste right into your batch file):

NetMailBot -to myname@email.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

If you have a larger number of recipients you wish to appear in the "To:" field of the outgoing message(s), consider using -tolist instead of typing them all on the command line.

If you have a "really large" number of recipients, stored perhaps in a Microsoft Excel spreadsheet or database, consider using NetMailBot's database connectivity features to retrieve the "To:" addresseses automatically with -dbuseaddressee and other parameters. Click here for an example using Excel.

If -to is not present then you must have at least one of these: -tolist , -preview or -popreply .


-tofriendly (-tf)

Category:

Addressing

Description:

The -tofriendly parameter adds personalization to your email. Instead of the recipient's email address appearing in the "To:" field of the email message header, a friendly name appears. For example "To:" would show "John Doe" instead of "jd76@somecompany.com".

The "To:" field in an email client can display the email address (e.g. abc34@somecompany.com), an equivalent "friendly" name (e.g. "Bob Smith"), or both. Client behavior varies as to what exactly is displayed. Many clients display e.g.:

To: "<friendly>" <email address>

In others, if the "Friendly" address is present, the "normal" email address is not displayed.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server

See Also:

-tolist

Usage:

-tofriendly "<friendly recipient name>"

Example (cut-and-paste right into your batch file):

NetMailBot -tofriendly "John Doe" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-tolist (-tl)

Category:

Addressing

Description:

Filename of "To:" address list. The file should contain a comma-delimited list of email addresses.

Optional?

Yes.

Overrides:

-to

Overridden By:

None.

Other Parameters Required:

-from -server

See Also:

-delimiter -to

Usage:

-tolist "<to list filename>"

Example (cut-and-paste right into your batch file):

NetMailBot -tolist "c:\temp\maillist.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-verify (-vf)

Category:

SMTP Server Communication

Description:

NOTE: Email address verification is maintained in NetMailBot for backward compatibility with older versions, but is no longer a supported feature.

Verifies all email addresses specified with the -to , -tolist , -cclist , and -bcclist parameters. If a single email address is specified after the -verify parameter, only that email address will be verified.

Optional?

Yes.

Overrides:

None.

Overridden By:

(Sending and/or receiving of email - one cannot verify and send in the same invocation; it must be a two-step process).

Other Parameters Required:

For single email address verification: -dnsservers

For multiple email address verification: -dnsservers ( -to , -tolist , -cclist , or -bcclist)

See Also:

-from

Usage:

-verify <optional single email address>

Examples (cut-and-paste right into your batch file):

Example #1: Verify one email address:

NetMailBot -verify email@domain.com -from email@domain.com

Example #2: Verify multiple addresses contained in the comma delimited file named "c:\temp\list.txt":

NetMailBot -verify -tolist "c:\temp\list.txt" -from email@domain.com

Comments:

NOTE: Again, email address verification is maintained in NetMailBot only for backward compatibility with older versions, but is no longer a supported feature.


-watchdir (-wd)

Category:

Attachments

Description:

Specifies a directory to watch for files to send as attachments. NetMailBot will continuously monitor the directory and until the key combination CTRL-C is pressed.

NOTE: Requires either -watchmoveto or -watchdelete to also be specified. When a file is detected in the watch directory, NetMailBot must either move it to another location or delete it after performing any other specified actions (e.g. sending it as an attachment) to avoid mistaking it for a "new" file matching the filemask the next time it checks the directory.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -watchmoveto or -watchdelete )

See Also:

-filemask -watchexit -watchwait -zip -attachsubfolders -watchfilenameisto -watchfilenameisbody -watchone

Usage:

-watchdir "<path to selected watch dir>"

Example (cut-and-paste right into your batch file):

NetMailBot -watchdir "C:\Documents and Settings\reports" -watchdelete -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchdelete (-wde)

Category:

Attachments

Description:

Switch used with -watchdir parameter that specifies that files should be deleted after they are sent.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -watchdir

See Also:

None.

Usage:

-watchdelete

Example (cut-and-paste right into your batch file):

NetMailBot -watchdelete -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchexit (-we)

Category:

Attachments

Description:

Switch used with -watchdir to exit after files found in the watch directory are sent as attachments. Used, therefore, for "one shot" directory watches - NetMailBot will wait patiently until files (optionally matching the -filemask ) appear in the directory. It will then act as directed and exit.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -watchdir

See Also:

None.

Usage:

-watchexit

Example (cut-and-paste right into your batch file):

NetMailBot -watchexit -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchfilenameisbody (-wfib)

Category:

Attachments

Description:

Switch used with -watchdir where the file found becomes the body of the email message instead of attaching the file.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-from -server -watchdir

See Also:

-watchfilenameisto -watchfilenameissubject

Usage:

-watchfilenameisbody

Example (cut-and-paste right into your batch file):

NetMailBot -watchfilenameisbody -watchexit -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchfilenameissubject (-wfis)

Category:

Attachments

Description:

Switch used with -watchdir where the file found becomes the subject of the email message. The file is still attached.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-from -server -watchdir

See Also:

-watchfilenameisto -watchfilenameisbody

Usage:

-watchfilenameissubject

Example (cut-and-paste right into your batch file):

NetMailBot -watchfilenameissubject -watchexit -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchfilenameisto (-wfit)

Category:

Attachments

Description:

Switch used with -watchdir where the filename found becomes the "to" email address, format: email@domain.com (no extension, e.g. .txt, .doc, etc.). The file is still attached.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-from -server -watchdir

See Also:

-watchfilenameisbody -watchfilenameissubject

Usage:

-watchfilenameisto

Example (cut-and-paste right into your batch file):

NetMailBot -watchfilenameisto -watchexit -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

When used, the -to parameter is not required.

If the filename found is not in the form of a valid email address, e.g. "filename.ext", NetMailBot will still attempt to send an email, but will undoubtedly fail.


-watchmoveto (-wm)

Category:

Attachments

Description:

Switch used with -watchdir parameter that specifies that files should be moved after they are sent.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -watchdir

See Also:

None.

Usage:

-watchmoveto "<path to selected moveto dir>"

Example (cut-and-paste right into your batch file):

NetMailBot -watchmoveto "C:\Documents and Settings\Sent" -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchone (-wo)

Category:

Attachments

Description:

Switch used with -watchdir causes each file found is sent in a separate email.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -watchdir

See Also:

None.

Usage:

-watchone

Example (cut-and-paste right into your batch file):

NetMailBot -watchone -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


-watchwait (-ww)

Category:

Attachments

Description:

Specifies the number of milliseconds (1/1000 of a second) to wait between checking the specified watch directory for new files to send.

By default, the waiting time is set to 60000 or 1 minute.

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server -watchdir

See Also:

None.

Usage:

-watchwait "<period of checking the watch directory in milliseconds>"

Example (cut-and-paste right into your batch file):

NetMailBot -watchwait 5000 -watchdir "C:\Documents and Settings\reports" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "Report - Sent Fresh to Your Inbox Every Five Seconds!"

Comments:

None.


-zip (-zi)

Category:

Attachments

Description:

Switch/Parameter used to compress all attachments into a .zip file as a single attachment.

Specify a filename after this parameter to name the attachment, otherwise, "attachment.zip" is used.

Works with -watchdir parameters, -attachment , -attachmentdir , and -attachmentlist .

Optional?

Yes.

Overrides:

None.

Overridden By:

None.

Other Parameters Required:

-to -from -server ( -attachmentdir or -attachmentlist or -watchdir ; or anything else to do with attachments)

See Also:

None.

Usage:

-zip

Example (cut-and-paste right into your batch file):

NetMailBot -zip -attachment "C:\Documents and Settings\report.xls" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

Comments:

None.


Frequently Asked Questions

Here we have listed many of the common questions encountered in the use of NetMailBot.

Q: NetMailBot successfully sends my email, but my SMTP server rejects it, saying that authentication is required. What does this mean?

A: Most likely you must authenticate with the SMTP server in order to send email, that is, supply a user name and password. In this case, use NetMailBot's -authlogin and -authpassword parameters to supply your authentication credentials to the SMTP server.

This problem can also appear as an error message from NetMailBot saying that "relaying is denied on this server".

Since different SMTP servers can report the need for authentication differently, we suggest using -logfile and -debug to capture all of the details of the communication between NetMailBot and the server to a logfile. There you can search for some sort of message from the SMTP server complaining about the need to authenticate.

Q: How can I upgrade my NetMailBot trial to the full version?

A: If you are a current license holder of NetMailBot, please contact us for information on upgrading to the newest version: info@exclamationsoft.com .

Q: Everything seems to go fine with sending emails with NetMailBot - I receive no errors, either from NetMailBot, my sending SMTP server, or any of my recipients' receiving SMTP servers, yet some of my intended recipients still get no email. What is happening?

A: An increasing "problem" is the use of Unsolicited Commercial Email (UCE, or commonly referred to as "SPAM") filtering. Recall that NetMailBot communicates directly with your sending SMTP server, but the sent emails have to make their way to the recipients' receiving SMTP servers and ultimately to your recipients' mail clients. Along this chain, a mail might be judged as "SPAM" and filtered out, possibly at the receiving server, or at a client program. Unfortunately there is no way to control this from your end. If people who are expecting your mail complain that they never receive it, and you encountered no errors in sending it, they might want to check with their system administrators to see if their receiving mail server is configured for "SPAM" filtering.

Q: What kinds of things can affect the performance of NetMailBot?

A: NetMailBot is able to process thousands of email addresses per hour, and is successfully used in email campaigns consisting of tens of thousands of emails. We have found through our interactions with customers, however, that for reasons not completely known, performance is best when NetMailBot, your SMTP server, and your DBMS all run on the same machine. In fact, using a remote SMTP server can have a manyfold negative impact on performance, although it tends not to be problematic unless you are at the level of sending tens of thousands of emails. Thus, we recommend using a SMTP server local to the machine when you can. Of course, overall, performance can vary according to many factors, such as the available bandwidth of your connection to the internet, your machine speed, etc.

Here are some data on a trial run we conducted in-house at ExclamationSoft:

  • 35,000 email messages, sent 1 at a time
  • Personalization of the messages was done on email address, first name, last name
  • Message size was less than 1KB
  • Email server was local Microsoft IIS Virtual SMTP Server
  • Database was Microsoft SQL Server 2000
  • Machine Specs: AMD Athlon 1800+, 512 MB memory
  • Total time to send: 1 hour 57 minutes, or roughly 17,500 emails per hour

One of our customers who uses NetMailBot for mass email campaigns tends to send on the order of 70,000 emails in one mailing (this was as of February 2003, and their membership list was steadily growing!). Although we do not know their machine specs, the customer, using a local SMTP server (i.e. on the same machine as NetMailBot) has realized sending rates of 20,000 emails per hour (the customer's network connection to the internet was a 10MB connection). Thus, even on a single machine, NetMailBot can achieve tremendous email sending performance.

Another of our internal runs (with an SMTP server local to the machine on which NetMailBot ran) achieved a send rate of 200,000 mails in 6 hours, or roughly 33,000 mails per hour.

NetMailBot is a single-threaded email application - it sends out one email at-a-time. An alternative approach to sending very large batches of email is to run multiple instances of NetMailBot in parallel, on different machines or even on the same machine.

Q: NetMailBot complains with the following error: "Cannot address message. Either the mail server does not accept 'friendly' names or the from email address has been rejected - Cannot continue." What does this mean?

A: This is another common situation indicating the need to authenticate to the SMTP server. See other FAQs in this list and also the NetMailBot's -authlogin and -authpassword parameters.

Q: I am unable to send email to anyone outside of my domain. Why is that?

A: Authentication problems are common and show up in different forms. Another of these confusing situations is that the SMTP server is configured so that if users do not authenticate to the server, then they can only send emails within the SMTP server's domain but not to external domains. For example, if XYZ Corporation's SMTP server is smtp.xyz.com, then users such as joe@xyz.com and sally@xyz.com can send emails to each other, but not to sam@someotherplace.org. In order to get access to external recipients, senders must authenticate to the server. Use NetMailBot's -authlogin and -authpassword parameters to supply your authentication credentials to the SMTP server.

We suggest using -logfile and -debug to capture all of the details of the communication between NetMailBot and the server to a logfile, as different SMTP servers can "complain" about the need for authentication in different ways. For example, one customer's server reported:

"error 553 This domain isn't in my list of rcpthost"

...and this turned out to be another situation requiring authentication.

If using NetMailBot's authentication parameters seems not to work, you may have to talk to the administrator of your SMTP server to find out if there is some configuration problem that might ultimately be to blame. In some cases, your IP address or machine name needs to be added to a list of users able to send mail to domains outside of yours. As different SMTP servers can be configured differently, we cannot give specific advice. It might be useful, however, to let your administrator know that NetMailBot supports what is known as "PLAIN TEXT AUTHENTICATION".

Q: I can't verify (-verify) email addresses while sending emails. Why not?

A: You cannot simultaneously send emails with NetMailBot and verify the intended recipient email addresses with the -verify parameter. This is two-step process - first, you should run a verification pass, then remove any questionable email addresses (or reported known "bad" ones) and then do a sending pass.

NOTE: Email address verification is maintained in NetMailBot for backward compatibility with older versions, but is no longer a supported feature.

Q: How can I find out the name of my SMTP server?

A: Your ISP should provide that information for you in your sign-up information.

You can also look it up using a tool called "nslookup" on Windows NT 4.0/2000/XP/2003. Refer to the following Microsoft Support case for more information:

http://support.microsoft.com/default.aspx?kbid=200525

Alternatively, if you have received an email from someone who you know uses the same SMTP server you intend to use (for example, your company's email server), then you can look at the SMTP header information in that received email to figure out the sending SMTP server. Look for a feature in your message client to show you the message's "Details" or the "Message Source".

Q: How do I specify the name of my SMTP server machine in the -server parameter?

A: You should give the machine's name on its domain, e.g. mail.domain.com or smtp.mail.com. If you are not sure what this should be, ask your network administrator or ISP. If you are inside the network (e.g sending email via a mail server on another machine in your corporate LAN), ask your network administrator how to specify the machine name.

Q: I use AOL for my ISP, and I tried specifying their mail server in the -server parameter to send mail, but it failed. Why?

A: You will need to use an SMTP server which you have control over (or with which you are permitted to send mail and you have access to its administrators) either through a web host, another ISP, or a free email account. Experience indicates that AOL does not allow sending out email with their mail servers, so you will have to find a different provider.

There are a number of free email services out there that will allow you to use their SMTP servers to send out email. Try searching for e.g. "Free SMTP Access" on the internet.

Q: I want to send emails to a list of "Bcc:" (Blind Carbon Copy) recipients, but the -to parameter seems to be required. Is it?

A: Yes, it is. SMTP servers require a "To:" recipient. For most cases, you can use your own email account or a dummy account that you can clean out later. Of course, if you can send one email to many "Bcc:" recipients, then you only have to delete one email from this "dummy" account. See our examples on addressing to get an understanding of how variations in how emails are addressed affect the actual number of emails sent out.

Q: Where on the NetMailBot command line do the replacement IDs work in mail merges?

A: You can use replacement IDs on those parameters that "make sense" for substitution in mail merges, such as addressing ( -to , -tofriendly , -from , -fromfriendly , -cc , -bcc , etc.), and message content ( -subject , -body , -bodyfile , etc.). Of course you wouldn't use mail merge features in, for two examples, the -server parameter, or in specifying which database column holds the email addresses ( -dbemailcolumn ). If you encounter any problems with the replacement IDs, you can always inquire at our support department for help.

Q: I can't get the Mail Merge functionality to work. I have set up my DSN, specified my query and email column in the database, and set up my replacement IDs, but to no effect. What is wrong?

A: The most common mistake in using the mail merge features culminating in this situation is simply omitting the -personalize parameter - this is the "switch" that actually causes NetMailBot to do the personalizing / mail merge. All the rest are just setting this up. If you add -personalize and still have problems, it could be your DSN, database query, etc.

Q: I am unable to access my database with NetMailBot. My attempt fails with this (or a similar) error: "Error: -2147467262 Msg: No such interface supported Description: Database initialization failed."

A: This is a common error indicating that your computer does not have the latest Microsoft MDAC components installed. These are required for use with NetMailBot. At the time of this writing, you can get the latest MDAC components at:

http://msdn.microsoft.com/data/Default.aspx

Look for "MDAC Downloads".

Q: I'm not sure what DSN to use for my particular database. Can you give me any advice?

A: Two websites specializing in DSNs and connection strings for all sorts of databases and connectivity mechanisms are:

http://www.connectionstrings.com/

http://www.able-consulting.com/ADO_Conn.htm

Although we can't vouch for the accuracy of the information provided at these sites, we find them to be handy resources to have, so we've provided them here.

Q: NetMailBot stops if a bad email address is encountered and triggers and error with my SMTP server. How can I get around this?

A: In the case where one is sending to more than one email address and -recipientlimit is set to 1, NetMailBot will stop if it encounters a bad email address. In all other cases, NetMailBot will continue on with processing. This is by design, due to the fact that there are cases with our customers who use NMB for automation or scheduled sends, where one does not want processing to continue when a bad email address is encountered.

The recommended approach is to clean out the mail list by database queries outside of NetMailBot, or by performing a test run, using -test , to capture the bad email addresses in the bad email log file, and remove them before the live mailing. "Clean and Purge", so-to-speak.

Q: When using mail merge, since the recipient email addresses are taken from the database, what should I put in the -to parameter (since it is required)?

A: You can actually put in any email address you like, since it is ignored in this case.

Q: I'm using a wildcard (*) in my -attachment parameter path because I want to attach any files of a particular type, but it isn't working. How do I use wildcards with attachments?

A: This is a common confusion. Customers often attempt something like:

-attachment "D:\Reports\CurrentWeek\Rep*.txt"

However, NetMailBot accomplishes the desired effect with the -filemask parameter; the -attachment parameter can be used to specify individual explicitly named files, or the -attachmentdir parameter can be used to specify a directory in which to look (any files appearing there will be attached). -filemask allows you to filter out any files not meeting the specified criterion. So, the above example would be changed to:

-attachmentdir "D:\Reports\CurrentWeek\" -filemask "Rep*.txt"

See the individual parameters' documentation for more details.

Q: I am trying to send very large attachments (on the order of megabytes or even tens of megabytes) and my attempts are failing. What is the problem? Is NetMailBot limited in how large an email it can send?

A: NetMailBot is only limited by the restrictions imposed by your mail server. For example, many mail servers have a 10MB limit to the size of an email. What is most likely happening is that the connection between NetMailBot and your mail server is timing out before the entire mail can be sent.

NetMailBot provides the -generaltimeout parameter to get around this problem. You specify (in milliseconds) how long the connection should be kept alive. A setting of 60,000 ms gives one minute. You might have to experiment to find a good number; one customer was sending attachments on the order of 20-30MB and was still having timeout problems with a setting of -generaltimeout 1200000 (which amounts to 20 minutes), but of course it all depends on what bandwidth you can expect from your internet connection.

As an interesting note, we did have a customer who was indicating that NetMailBot was splitting their large attachment (on the order of 28 MB) into 8 pieces and was sending these consecutively to the same "To:" address. We noticed that they were using the -failsafe parameter. As NetMailBot does not split attachments, we investigated and concluded that what was actually happening was that the SMTP server connection was timing out repeatedly, giving the illusion that the attachment was being sent over 8 emails!

Q: I'm using Microsoft Access for my database, and I'm getting an error: "data type mismatch in criteria expression". What is the problem?

A: This might have something to do with your database query. Access query values should be encapsulated in pound signs, for example:

-dbquery "Select email FROM customers WHERE purchase_date = #10/7/2002#"

Pound signs are the only thing that should encapsulate a query for Access.

Q: Does the NetMailBot installer support "silent installation"?

A: The installation package for NetMailBot does not support a silent install. However, there are only 5 files needed for NetMailBot to work: one executable (.exe) and four supporting DLLs (.dll) - none of which need to be registered.

You could easily copy all 5 files to the chosen installation path and it would work without any problems.

Q: What are the details of the NetMailBot installation?

A: There are a number of files that are included in the installation of NetMailBot. We use Wise Installer, a recognized installation utility, to install all of our files.

Primarily, there is the main executable:

NetMailBot.exe

...and supporting DLLs, created by us:

BotDll.dll - Utility functionality.
DBDll.dll - Database functionality.
MailDll.dll - Mail protocol functionality.
MailListBotDll.dll - Wraps MailDll.dll functionality into higher level functions.

And system DLLs that we update if necessary:

MFC42.DLL - Version 6.x.
MSVCRT.DLL - Version 6.x.

And of course, numerous help files, all HTML files, that do not overwrite or affect anything. There are no system services installed. NetMailBot does not replace any files in the C:\windows\command (or C:\WINNT\system32) directory. The files install to the X:\Program Files\NetMailBot directory (X: being whatever drive letter applies); and the installer will update MSVCRT.DLL, MFC42.DLL, and MSVCP60.DLL. In addition the installer will place the netmailbot directory in your system PATH.


Reference

Here we present various topics useful for reference when using NetMailBot, such as operating system features you might need to access.


How to Install Dialup Networking in Windows 95/98

Purpose

To install the Dial-Up Networking component in Windows 95 or 98, do the following:

  1. Double-click My Computer.

  2. Double-click Control Panel.

  3. Double-click Add/Remove Programs.

  4. Click the Windows Setup tab.

  5. Click to check Communications. Click OK.

Ensure the Windows CD is in the drive, and/or the correct installation folder is selected. If you are prompted to select a drive or folder, select the location of the Windows cabinet files (*.CAB).

  6. After the system is finished copying files, you will be prompted to restart the computer. Click Yes. The system will restart, initializing the Dial-Up Networking components.


How to Set Up Dialup Networking to Automatically Dial and Disconnect

For Internet Explorer 5.0 and higher on Windows 95/98/2000 Pro/XP:

  1. Click Start, click Control Panel, click Internet Options
  2. Click on the Connections tab:

  3. If you already have a Dial up connection created go to step 5
  4. Click on the Add button and follow the instructions to create a new dial-up networking connection
  5. To have Windows automatically dial your selected dial-up connection, choose either the "Dial whenever a network connection is not present" or "Always dial my default connection" radio button.
  6. Click on the Settings button. The Dial-up Connection Settings dialog box will appear:

  7. Ensure all of the settings are correct and click on the Advanced tab. The Advanced Dial-up dialog box will appear:

  8. Check the appropriate checkboxes for how you would like to automatically disconnect.

When any application that uses the Internet is started, the auto-dialer will automatically start.


More Information on DOS Batch Scripting

The website located here contains additonal information on DOS batch file scripting.

NOTE: Clicking on the link will open a new window and leads to a site not affiliated with NetMailBot or ExclamationSoft.


How to Set Up a DSN

Purpose

This topic discusses how to set up a DSN (ODBC Data Source Name) for a Microsoft Access database connection. DSNs for other databases will be similar. See the link at the bottom of this page for a resource enumerating DSNs for several popular database types.

NOTE: The screenshots may look somewhat different depending on your particular version of Windows.

  1. Open the Control Panel:

  2. Next, add a user DSN by clicking on he Add button on the screen below:

  3. After clicking the Add button, you will see the following screen:

Select "Microsoft Access Driver", then click the Finish button.

  4. The following screen will appear:

Enter a name in the field "Data Source Name". For example, you can name it MyDatabase.

  5. Click on the button "Select" to choose an Access database. The "Select database"dialog will appear:

Click the OK button after you have selected the Access database.

  6. Click the OK button to close the "ODBC Microsoft Access Database" dialog. You should now see the MyDatabase in the alphabetical list of DSNs:

  7. You are finished!

See www.connectionstring.com for some example DSNs for popular databases.


System Temporary Directory

Purpose

The System Temporary Directory is a location on a Windows system's hard drive where temporary files are created and used with the intention that the files can be deleted at any time after they have been used.

NetMailBot uses this directory to store temporary files when:

  • Downloading a web page and its images to send as an email message
  • Downloading messages from a POP3 email server.

How to find the System Temporary Directory: Windows

  1. Click on the "Start" button.
  2. Select "Run"
  3. Type %TEMP%
  4. A new window should open and display the contents of your System Temporary Directory.

How to find the System Temporary Directory: DOS

  1. Open a DOS Command Window.
  2. Type "echo %TEMP%"
  3. To change to the system temporary directory, type "cd %TEMP%". If your system has multiple hard drives or partitions, you may need to change the drive letter to the drive that the temporary directory is on. For example, to change to the "C" drive type "c:"


How to find the SMTP Mail Server for an Email Address

Purpose

This example helps determine the mail server for a given email address. This is useful for determining your own SMTP mail server to use with NetMailBot.

If you are unsure of the name of the mail server for an email address, first try "mail.domain.com" or "smtp.domain.com". If niether work, try the following.

Requirements

Windows 98/Me/NT/2000/XP/2003. Not available for Windows 95.

Steps

  1. Open a DOS Command Prompt
  2. Type "nslookup".
  3. Your computer's DNS Server name and IP address will be displayed.
  4. Type "set type=mx" - This will cause NSLOOKUP to only return what are known as MX (Mail eXchange) records from the DNS servers.
  5. For an example, type "hotmail.com" or use your own domain name.
  6. Results returned should look similar to this:

Server: ns1.xxx.com

Address: 192.168.0.1

Non-authoritative answer:

hotmail.com MX preference = 5, mail exchanger = mx2.hotmail.com

hotmail.com MX preference = 5, mail exchanger = mx3.hotmail.com

hotmail.com MX preference = 5, mail exchanger = mx4.hotmail.com

hotmail.com MX preference = 5, mail exchanger = mx1.hotmail.com

hotmail.com nameserver = ns1.hotmail.com

hotmail.com nameserver = ns2.hotmail.com

hotmail.com nameserver = ns3.hotmail.com

hotmail.com nameserver = ns4.hotmail.com

mx2.hotmail.com internet address = 65.54.254.145

mx2.hotmail.com internet address = 65.54.252.230

mx2.hotmail.com internet address = 65.54.166.230

mx3.hotmail.com internet address = 65.54.254.140

mx3.hotmail.com internet address = 65.54.253.99

mx3.hotmail.com internet address = 65.54.167.5

mx4.hotmail.com internet address = 65.54.254.151

mx4.hotmail.com internet address = 65.54.253.230

mx4.hotmail.com internet address = 65.54.167.230

mx1.hotmail.com internet address = 65.54.254.129

mx1.hotmail.com internet address = 65.54.252.99

mx1.hotmail.com internet address = 65.54.166.99

ns1.hotmail.com internet address = 216.200.206.140

ns2.hotmail.com internet address = 216.200.206.139

ns3.hotmail.com internet address = 209.185.130.68

ns4.hotmail.com internet address = 64.4.29.24

  7. Note the first line after "Non-authoritative answer".

The "MX preference" specifies which mail server to use and in which order. The lower the number, the more preferred the mail server is. In this case, since the preferences for each mail server are the same, you can use any of the four "mail exchangers".


Return Codes
         Previous Topic

Purpose

As of build 1798, NetMailBot returns a number after each time it is executed. This is useful if you integrate NetMailBot with another program, and you need to determine if an email was sent.

After executing NetMailBot, you can display the return code by typing at the command line:

echo %errorlevel%

The following table maps each return code:

Return Code | Description
0 | Success - Email was sent successfully or email address verification complete.
1 | Success - Help was requested. Can also signify that an incorrect parameter was used or was missing.
2 | Failed to initialize MFC. The required MFC dlls are missing, corrupt, or your system is low on memory.
3 | Failed. General failure occurred before sending email. Check the log file for detailed information.
4 | Failed. Feature is not available.
5 | Failed. Alternate body text specified with -altbodyfile paramter is empty or missing.
6 | Failed. Body text specified with -bodyfile paramter is empty or missing.
7 | Failed. Attachment file specified with -attachment paramter is empty or missing.
8 | Failed. Attachment list file specified with -attachmentlist paramter is empty or missing.
9 | Failed. To list file specified with -tolist paramter is empty or missing.
10 | Failed. CC list file specified with -cclist paramter is empty or missing.
11 | Failed. BCC list file specified with -bcclist paramter is empty or missing.
12 | Failed. Email address verification failed. Check the log file.
13 | Failed. Sending email failed. Check the log file.
14 | Failed. Program Initialization failed. Check the log file.
15 | Verification of one email address - GOOD
16 | Verification of one email address - BAD.
17 | Verification of one email address - SUSPECT.
18 | Verification of one email address - FAILED. Check the log file for an error
19 | Success with warnings - not fully implemented.
20 | Database query failed
21 | POP3 "STAT" command (statistics) failed
22 | POP3 "RECV" command (receive email) failed.
23 | Retrieving of message header failed
24 | Deletion of message failed
25 | POP3 Server connection failed.
26 | Email message forward failed.
27 | Auto-reply email failed.
28 | -loadurl feature failed to load the specified URL
29 | File move failed using watch directory features
30 | -findmailserver failed


.topic HowToOpenADosPrompt
How to Open a DOS Prompt: