Automated E-mail Reports
page 3 of 5
by Andrew Mooney
Average Rating: 
Views (Total / Last 10 Days): 26832/ 32

How to Use the Application

For each report that you want emailed, you will need to create an XML (see Listing 3) file with the following report attributes set:

1. server - The name or IP address of the SQL Server

2. database - The name of the database

3. from - Email address used to send from

4. to - A comma separated list of the email addresses you want the report sent to.

5. mailserver - The name of the email server

6. title - This is the title of the report and the subject of the email.

7. select - The SQL select statement used for the report

8. sum - The SQL select statement used as a summary for the report

9. file - The name of the HTML file that is created and then emailed

To run the report, create a batch file (see Listing 4) that passes the report file name to the application. Then use Windows Task Scheduler to run this batch file at the frequency you desire. If you want to run multiple reports at the same frequency, for example, once a week on Monday at 9:00 AM, this can be done from one batch file.

If an error occurs, the application creates a file named EmailReports.log in the same directory and records the error. Any future errors will be added to this file.

View Entire Article

User Comments

No comments posted yet.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-20 8:26:04 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search