Solved

Automatic Email of report in HTML in ASP/oracle

Posted on 2004-03-23
7
921 Views
Last Modified: 2008-01-16
I need to send a report summary by email every morning (say) at 6:00 AM or every 6 hours. The report is nothing but a simple SQL query on the Oracle Database. Currently I am generating similar report in a aspx page that loads the SQL query and the result is sent manually by clicking the send email button. What is the best way to do this.
1) Have the report be generated in a aspx page that would somehow load every morning automatically at 6:00AM or every 6 hours or so and send the same to the FIXED email addresses (How???)

2) User Oracle to generate the report and send it at the appropriate time, if so how?

3)Some other method that I am not aware of

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
(the one I have now is the following:)
This page retrieves results from a query and sends it by email.
        mail.Body = "This is an auto generated email. Please do not reply. The status for " + strBcfID + " is " + strStatus + " at " + sentTime

        SmtpMail.SmtpServer = "localhost"
        SmtpMail.Send(mail)
0
Comment
Question by:nparthi
7 Comments
 
LVL 7

Expert Comment

by:ramesh12
ID: 10663179
I think there is somekind of scheduler that can be configured on Oracle server .

Try to use that .
0
 
LVL 4

Expert Comment

by:NetPointer
ID: 10663474
Do you really need aspx page?

All you need is to generate the mail. You can have console application which generates your mail body (thru your sql query) and send your mail. And you can use windows task scheduler to invoke this console application daily 6:00

HTH.

0
 
LVL 1

Expert Comment

by:balee
ID: 10665911
Here is one way.

1. Create a .sql file with your query you want to run and use spool to spool it's result into a file
2. Create a .bat file. Call sqlplus with your .sql file. Call some command line email tool to send the generated log file via email
3. Use windows scheduler to run the .bat file periodically

*We use blat.exe for sending mails. This is a command line mail tool. I don't know if it is free or what, you will find some free tools probably.

We use this way for database monitoring on windows.
0
 
LVL 1

Author Comment

by:nparthi
ID: 10670709
Hi NetPointer,
Can you point to me to a place on the web that gives more details about doing this as a console app?
0
 
LVL 4

Accepted Solution

by:
NetPointer earned 50 total points
ID: 10692283
Create a class like this.
then write the implementation of given two functions GenerateBody and SendMail. You know how to genrate body. for SendMail visit the site
http://www.systemwebmail.com/faq.aspx 
compile this cs file and u have your application ready.
using System;
using System.Web.Mail;
class Mailer
{
      public static void Main()
      {
            string body = GenerateBody();
            SendMail(string To, string mailbody, string subject);
      }
}
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question