How to send email to a list in Excel

This example demonstrates how to send email to a list of email addresses contained in an Excel spreadsheet.
  • Requirements
    1. Microsoft Excel - to edit the Excel spreadsheet included
    2. The latest ODBC drivers, available 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 an email address
    4. In cell A3, enter another email address
    5. Highlight all of the cells
    6. Select the menu item "Insert->Name->Define" (May be different for versions before Office 2000). A dialog box will appear.
    7. Enter the name of the range, "customer", then click "OK".
    8. Save the spreadsheet in an easy to find location, such as "C:\temp" and name the file "example.xls".
  • Create an ODBC DSN
    1. Create an ODBC DSN 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 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. Change the -to, -from, and -server parameters to your own email address and mail server. If you don't change these, the example will not work.