CSV (Text) File with Friendly Names
Previous Topic  Next Topic 

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

 

 

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:

 

 

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:

 

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

 

Your tracking number is <<tracking>>.

 

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

  1. Invoke the batch file by double-clicking the icon or straight from the command line.
  2. 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").