Solved

Sending mail

Posted on 2000-03-16
10
172 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now