Solved

How to use the exchange server to make a PRG. that send mails

Posted on 2001-06-27
4
170 Views
Last Modified: 2010-04-06
dear's
we have a windows NT 4 server and SQL Server database.
i want to collect data from database and send it as report, text  (what ever) to the managers on their mails.
this automatice.
Thanks
Ahmed Ragab
0
Comment
Question by:RAGAB2000
  • 2
4 Comments
 

Author Comment

by:RAGAB2000
Comment Utility
Thanks
0
 
LVL 8

Expert Comment

by:Cesario
Comment Utility
use the MAPI Unit to send data to the exchange Server...

We have no exchange Server installed on ower system. so I am not able to test the source code....

but it very easy to unterstand the Procedure and Functions in the MAPI Unit

Best Regards

Cesario
0
 
LVL 1

Accepted Solution

by:
drnadeem earned 100 total points
Comment Utility
put a button and NMSMTP component on a form. Prepare your report using query or whatever. Then you can send it as an attachement to the mail.


procedure TMailF.NMSMTP1Connect(Sender: TObject);
begin
 NMSMTP1.SubType := mtPlain;
 with NMSMTP1.PostMessage do begin
    FromAddress := 'your@yourmail.com'; //your email
    ToAddress.Add('manager1@yourcompany.com');//manager1
    ToAddress.Add('manager2@yourcompany.com');//manager2
    ToCarbonCopy.Add('cc@yourcompany.com');//cc address
    ToBlindCarbonCopy.Add('bcc@yourcompany.com');//bcc address
    Subject := 'Your subject';
    Body.Add(SubEd.Text);//subEd is memo containg body.
    Attachments.Add('c:\windows\desktop\report.doc');
  end;
  NMSMTP1.SendMail;
  NMSMTP1.disConnect;
end;

procedure TMailF.Button1Click(Sender: TObject);
begin
  NMSMTP1.Host := 'mail';
  NMSMTP1.Connect;
end;
0
 

Author Comment

by:RAGAB2000
Comment Utility
Thanks
I test the solution and it working will
Thanks again
Ahmed Ragab
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
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

13 Experts available now in Live!

Get 1:1 Help Now