whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

33 Visitors Online


 
...send an e-mail?
Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Print tip ]  

Tip Rating (15):  
     


{
  You must have the component TNMSMTP from FastNet tools.
  This component is included in Delphi 4-5 Professional and Enterprise

  Die TNMSMTP von FastNet tools wird benötigt.
  Die Komponente ist in Delphi 4-5 Professional
  und Enterprise Versionen enthalten.
}


procedure TForm1.Button1Click(Sender: TObject);
begin
  
NMSMTP1.Host   := 'mail.host.com';
  NMSMTP1.UserID := 'Username';
  NMSMTP1.Connect;
  NMSMTP1.PostMessage.FromAddress       := 'webmaster@swissdelphicenter.ch';
  NMSMTP1.PostMessage.ToAddress.Text    := 'user@host.com';
  NMSMTP1.PostMessage.ToCarbonCopy.Text := 'AnotherUser@host.com';
  NMSMTP1.PostMessage.ToBlindCarbonCopy.Text := 'AnotherUser@host.com';
  NMSMTP1.PostMessage.Body.Text         := 'This is the message';
  NMSMTP1.PostMessage.Attachments.Text  := 'c:\File.txt';
  NMSMTP1.PostMessage.Subject           := 'Mail subject';
  NMSMTP1.SendMail;
  ShowMessage('Mail sent !');
  NMSMTP1.Disconnect;
end;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners