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.
- Microsoft Excel - to edit the Excel spreadsheet included
- The latest ODBC drivers, available at the Microsoft website
Create an Excel Spreadsheet
- Open Microsoft Excel.
- In cell A1, enter the text "email"
- In cell A2, enter an email address
- In cell A3, enter another email address
- Highlight all of the cells
- Select the menu item "Insert->Name->Define" (May
be different for versions before Office 2000). A dialog box will appear.
- Enter the name of the range, "customer", then
click "OK".
- Save the spreadsheet in an easy to find location,
such as "C:\temp" and name the file "example.xls".
Create an ODBC DSN
- Create an ODBC DSN named "example". For instructions
on creating an ODBC DSN, click here.
Create a batch file
- 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
- 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
- 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.
|