How to use ODBC with NetMailBot

Explanation of Parameters

NetMailBot has a number of parameters which make it easy to connect to an ODBC compliant database: (click each for short description) Follow these steps to have NetMailBot use your database:
  1. Set up an ODBC DSN (click here for an example on setting up an ODBC DSN)
  2. Create a batch file (click here for an example of creating a batch file)
  3. Add required parameters:
    1. -to
    2. -from
    3. -server
    4. -subject
  4. Add database paramters:
    1. -dsn (the name of the dsn created in step 1)
    2. -dbtable (the name of the table that contains the email addresses)
    3. -dbemailcolumn (the name of the column in the above table which contains the email address)
    4. -dbuseaddressee (specifies how to address each email, as a "to", "cc", or "bcc")

Example #1

The first example demonstrates sending an email to a list of bcc (blind carbon copy) recipients from a DSN named "customer", with a table named "customer_list". The table has a column named "emailAddress" which contains each customer's email address:
		
netmailbot -to test@test.com -from test@test.com -subject "Newsletter" 
-server mail.test.com -dsn "customer" -dbtable "customer_list"
-dbemailcolumn "emailAddress" -dbuseaddressee "bcc"
		
		

Example #2

The first example demonstrates sending an email to a list of recipients from a DSN named "leads", with a table named "portfolio". The table has a column named "contact" which contains each customer's email address. Each email will be personally addressed to each email address by using the -recipientlimit parameter.
		
netmailbot -to test@test.com -from test@test.com -subject "Newsletter" 
-server mail.test.com -dsn "leads" -dbtable "portfolio"
-dbemailcolumn "contact" -dbuseaddressee "to" -recipeintlimit 1