Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Internet
Register FAQ Members List Calendar Guía de estilo Today's Posts

Colaboración Paypal con ClubDelphi

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12/07/2005
dec's Avatar
dec dec is offline
Moderador
 
Join Date: Dec 2004
Location: Alcobendas, Madrid, España
Posts: 13,142
Poder: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Esto no me va mal en Delphi 7 con Indy 9.

Código Delphi [-]
uses
   IdSMTP, IdMessage;
   
 procedure TForm1.Button1Click(Sender: TObject);
 var
   smtp: TIdSMTP;
   mail: TIdMessage;
 begin
   smtp := TIdSMTP.Create(Self);
   mail := TIdMessage.Create(Self);
   
   with smtp do
   begin
     Port := 25;
     Host := 'smtp.servidorcorreo.es';
     Username := '';
     Password := '';
   end;
   
   with mail do
   begin
     Recipients.Add;
     Recipients[0].Name := 'destinatario';
     Recipients[0].Address := '[email protected]';
     From.Name := 'remitente';
     From.Address := '[email protected]';
     Subject := 'Asunto del correo';
     Body.Text := 'Cuerpo del correo';
   end;
   
   TIdAttachment.Create(mail.MessageParts, 'C:\adjunto.txt');
   
   smtp.Connect(30000);
   try
     try
       smtp.Send(mail);
     except
       on E: Exception do
         ShowMessage(E.Message);
     end;
   finally
     if smtp.Connected then
       smtp.Disconnect;
   end;
 
   mail.Free;
   smtp.Free;
 end;
__________________
David Esperalta
www.decsoftutils.com

Last edited by dec : 12/07/2005 at 15:34. Reason: (corrección del texto)
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 05:30.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi