Solved

Automatic Email of report in HTML in ASP/oracle

Posted on 2004-03-23
7
930 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to Office 1 67
Looking for a link to download the latest .NET redistribution package 5 43
orderby list (from Json) 1 44
VB .net 2010 Byte array 2 22
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 article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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