Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automatic Email of report in HTML in ASP/oracle

Posted on 2004-03-23
7
Medium Priority
?
944 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 200 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 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