Solved

Sending mail

Posted on 2000-03-16
10
173 Views
Last Modified: 2010-04-04
I want to add a mail-comments-to-author-form to my Delphi app. Is there any way I can do this without having to deal with mail-clients and stuff? I want my user to be able to send me a mail just by clicking a button.

-Would also be useful to be able to determine if the user is online or not.
0
Comment
Question by:sageryd
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 200 total points
ID: 2625573
There is good example in delphi\demos\intenet\smtp directory

Here's another using the TNMSMTP component that ships with Delphi:

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

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

Cheers,

Raymond.

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2626037
Try F. Piette's SMTPCLI component. It includes good examples:

http://www.rtfm.be/fpiette/indexuk.htm


Or try the WinShoes comonent from:

http://www.nevrona.com/main-winshoes.html
0
 
LVL 15

Expert Comment

by:simonet
ID: 2626041
FOllowing...
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2626056
Ah yes, I already thought I heard footsteps behind me   :o)
0
 
LVL 15

Expert Comment

by:simonet
ID: 2626069
I have a long way to go before I even come close to you, Epsylon!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:sageryd
ID: 2626741
Great answer Raymond! But my mailserver requires a password too. How can I send the password?
0
 
LVL 1

Author Comment

by:sageryd
ID: 2626771
Raymond, I figured it out. The SMTP doesn't need a password, only a correct sender-address. I got it to work. If the user has a modem, will it try to connect?
0
 
LVL 1

Author Comment

by:sageryd
ID: 2627853
How can I use this with a proxy?

--johan
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2630256
> If the user has a modem, will it try to connect?

This will depend how your DUN is configured. MS have quite different DUN setups for 95/98/NT/2000 so you will need to consulr the documentation for your appropriate OS.

> How can I use this with a proxy?

Good question. The PAQ may help you:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10150125 

Cheers,

Raymond.


0
 
LVL 1

Author Comment

by:sageryd
ID: 2645765
No...it didn't help...I'll post a new Q about it. Thanx!

--johan
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

17 Experts available now in Live!

Get 1:1 Help Now