How to send an email...

I would like my program to send a mail, but I don't want it to launch another program first... Is there an easy way to do this?

I use Delphi4 client/server-edition.

If someone should suggest a component, then please give me an eksample using it...

regards
retep
retepAsked:
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.

intheCommented:
hi,
i recommend temail32 it great mapi component and comes with 3 examples.
can be found on torrys :
http://www.torry.ru/internet.htm

or just use the smtp component on you internet components tab :
example:

nmsmtp1.PostMessage.Attachments := list of filenames;
nmsmtp1.PostMessage.FromAdress := ...
nmsmtp1.PostMessage.ToAddress := ..
nmsmtp.postmesage. othersettings := ..
nmsmtp1.sendmail;

Regards Barry

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
retepAuthor Commented:
Hi InThe :-)

Thanks for your reply. Could you give me a full eksample of how to use Tnmsmtp? I've tried it, but can't seem to make it work. I'll gladly post more points if needed.


Retep

0
rwilson032697Commented:
There is a good one in the stmp demo in $(Delphi)\demos\fastnet\smtp (though it may have more detail than you need - take a look).

Cheers,

Raymond.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

intheCommented:
there is good example in delphi\demos\intenet\smtp directory

but here another:



procedure TForm1.Button1Click(Sender: TObject);
begin
  if not(nmsmtp1.Connected)
  then begin
    nmsmtp1.Host:= 'mail.enterprise.net';
    nmsmtp1.UserID := 'your userid';
    nmsmtp1.Connect;
  end;

  if nmsmtp1.Connected
  then
  begin
    nmsmtp1.ClearParams := True;
    nmsmtp1.SubType := mtPlain;
    nmsmtp1.EncodeType := uuMime;
    nmsmtp1.PostMessage.FromAddress := 'Legend@Enterprise.Net';
    nmsmtp1.PostMessage.ReplyTo := nmsmtp1.PostMessage.FromAddress;
    nmsmtp1.PostMessage.FromName := 'Barry';
    nmsmtp1.PostMessage.ToAddress.Add('BorgsAssmilate@Aol.Com');
    nmsmtp1.PostMessage.Body.AddStrings(Memo1.lines);
    nmsmtp1.PostMessage.Subject := 'A Test';
    nmsmtp1.PostMessage.Date := DateToStr(Date);
    nmsmtp1.SendMail;
    MessageDlg('Mail sent', mtInformation, [mbOk], 0);
  end
  else
    MessageDlg('NOT connected', mtInformation, [mbOk], 0);
end;



Regards Barry
0
intheCommented:
;-)  nice timing raymond
0
rwilson032697Commented:
Of course, in D4 the path would be $(Delphi)\demos\internet\smtp :-)

Cheers,

Raymond.
0
rwilson032697Commented:
Snap!
0
retepAuthor Commented:
Thanks a lot!!!

You have no idea how much time I have spend trying to make it work :-)
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.