Solved

Automatic Email of report in HTML in ASP/oracle

Posted on 2004-03-23
7
927 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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