Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sending mail

Posted on 2000-03-16
10
Medium Priority
?
184 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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