?
Solved

Sending mail

Posted on 2000-03-16
10
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 800 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

762 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