how to send mail?

Give me example of using senddoc function of the smtp-component of Delphi2,3.I want to send my file c:\temp\myfile.txt to mail@whom.net.
VadikAsked:
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.

sburckCommented:
Straight from the help file of Delphi 4, I don't know if it's back compatible with the older versions, but assuming it is, I tried this and it worked fine.

procedure TForm1.SendBtnClick(Sender: TObject);
begin
  NMSMTP1.PostMessage.FromAddress := LAddress.Text;
  NMSMTP1.PostMessage.FromName := LName.Text;
  NMSMTP1.PostMessage.ToAddress.Add(ToField.Text);
  NMSMTP1.PostMessage.ToCarbonCopy.Add(CCField.Text);
  NMSMTP1.PostMessage.ToBlindCarbonCopy.Add(BCCField.Text);
  NMSMTP1.PostMessage.Body.AddStrings(BodyField.Lines);
  NMSMTP1.PostMessage.Attachments.AddStrings(AttachmentsField.Lines);
  NMSMTP1.PostMessage.Subject := SubjectField.Text;
  NMSMTP1.PostMessage.LocalProgram := 'NMSMTP Demo';
  NMSMTP1.SendMail;
end;
0
VadikAuthor Commented:
Hi sburck! Unfortunately it doesn't work in D2,3 :-(  There is no PostMessage method in SMTP-component.  
0
intheCommented:
vadik see your other question about this ,the project link i gave you shows exactly how to send a email with a file attachment..
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
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.