Solved

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

Posted on 2001-06-27
4
178 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
ID: 6230873
Thanks
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6230994
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
ID: 6236825
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
ID: 6245485
Thanks
I test the solution and it working will
Thanks again
Ahmed Ragab
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 138
How to create virtual printer while installing my application 5 61
DBGrid or StringGrid ? 6 105
RESTRequest Parameter 4 43
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 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