Solved

Automatic Email of report in HTML in ASP/oracle

Posted on 2004-03-23
7
900 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now