Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Sending mail

Posted on 2000-03-16
10
Medium Priority
?
187 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 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
Technology Partners: 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 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