report by e-mail in delphi 3

how do i send a report by e-mail in Delphi 3?

what are my choices and what do i do?

thanks...
marcelomferreiraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PeterLarsenCommented:
Like this :

Use Tnmsmtp.

var
mail : TNMSMTP
begin

mail:=tNMSMTP.create(self); //or just place it on the form
Mail.PostMessage.Subject:='Some text';
Mail.Host:='MailServerName';
Mail.Port:=25;
Mail.UserID:='Your name - not very important';
Mail.PostMessage.FromAddress:='Your mail address';
Mail.PostMessage.FromName:='Your name - not very important';
Mail.PostMessage.ToAddress.Clear;
Mail.PostMessage.ToAddress.Add('E-mail address');
Mail.PostMessage.Attachments.Clear;
Mail.PostMessage.Attachments.Add('a file name');
Mail.PostMessage.Body.Text:='E-mail body - text';
Mail.Connect;
Mail.SendMail;
Mail.Disconnect;

/PL
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwilson032697Commented:
Listening
0
marcelomferreiraAuthor Commented:
Thanks, but I still have a problem...

How can the receiver read my report if it's in .QT format? Isn't there any way to send it inside the e-mail in Body section?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

PeterLarsenCommented:
Hmm, I dont get it. BODY is a TStringList. You may put almost anything in it.
Give me some details, please.
0
marcelomferreiraAuthor Commented:
Suppose I make a clients report, containing Code and Name ,like this:

==================================
      **** MY BUSINESS ****

          CLIENTS REPORT

CODE    NAME
   1    aaaaaaaaaaaaaaaaaaaaaaaaaa
   2    bbbbbbbbbbbbbbbbbbbbbbbbbb
   3    cccccccccccccccccccccccccc
==================================

To see this report I use:

rptClients.Preview;

but I want to print this report and send this in an e-mail, like this:

--------------------------------------
FROM: xxx@xxxxx.xxx
TO: zzz@zzz.zzz
SUBJECT: vvvvvvvvvvvvv
BODY:
==================================
      **** MY BUSINESS ****

          CLIENTS REPORT

CODE    NAME
   1    aaaaaaaaaaaaaaaaaaaaaaaaaa
   2    bbbbbbbbbbbbbbbbbbbbbbbbbb
   3    cccccccccccccccccccccccccc
==================================
--------------------------------------

The answer you gave me tells me to attach a file in my e-mail, ok? but I wish I could avoid attaching anything on it. It'd better if I send it directly in the body section.

Is there any way?
0
PeterLarsenCommented:
I dont see any problem by include that text in the body.

Just use the body property. If you dont know how to add strings in the body, take a look at TStringList in the helpfile.

var
 s : string;
begin
s:='==========================='+chr(10)+chr(13);
s:=s+'              **** MY BUSINESS ****';
Mail.PostMessage.Body.Text:=s;

or

Mail.PostMessage.Body.Clear;
Mail.PostMessage.Body.add('===========================');
Mail.PostMessage.Body.add('              **** MY BUSINESS ****');
0
marcelomferreiraAuthor Commented:
Ok. This text was an example. What about I have a very big report generated by Delphi containing 10 pages of clients data and this report is in the screen (viewed by command Preview).

How do I transfer everything from the report to the body section when I don't know what may be in the report preview?
0
PeterLarsenCommented:
I guess that this report is loaded from a file. If that's so, you can simply load it directly in to the body - like this : Mail.PostMessage.Body.LoadFromFile('filename');

If this wont do it, you have to give me some more information - like which application do you use to produce this report and what choice does this program gives you - is it possible to save it somehow ??
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.