Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 09-03-2016
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.669
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Bienvenido a clubdelphi, como siempre aconsejamos a los nuevos, no olvides leer nuestra guía de estilo, gracias por tu colaboración
Has incumplido un montón de normas de los foros, es normal, no lo sabías, por eso te indico que leas nuestra guía de estilo
Y después crea un hilo nuevo con tu duda, le pones un título descriptivo y explicas lo más detalladamente tu problema.

Y recuerda poner los tags al código fuente, ejemplo:



Gracias


Cita:
Empezado por superfile Ver Mensaje
ESTOY TRATANDO DE ENVIAR UN ARCHIVO POR CORREO CON DELPHI XE2 CON EL SIGUIENTE CODIGO Y ME GENERA UN ERROR
must issue a starttls command first
uses IdAttachmentFile;
procedure EnviarMensaje( sUsuario, sClave, sHost, sAdjunto, sAsunto, sDestino, sMensaje: String );
var
SMTP: TIdSMTP;
Mensaje: TIdMessage;
Adjunto: TIdAttachmentFile; //declaracion de la nueva variable
begin
SMTP := TIdSMTP.Create( nil );
SMTP.Username := sUsuario;
SMTP.Password := sClave;
SMTP.Host := sHost;
SMTP.Port := 587;//25;
//SMTP.AuthenticationType := atLogin;--indy9
SMTP.AuthType := satDefault;
// SMTP.AuthType := atlogin;
Mensaje := TIdMessage.Create( nil );
Mensaje.Clear;
Mensaje.From.Name := sDestino;
Mensaje.From.Address := sDestino;
Mensaje.Subject := sAsunto;
Mensaje.Body.Text := sMensaje;
Mensaje.Recipients.Add;
Mensaje.Recipients.Items[0].Address := sDestino;
if sAdjunto <> '' then
begin
if FileExists( sAdjunto ) then
// Adjunto := TIdAttachment.Create( Mensaje.MessageParts, sAdjunto ); --indy9
Adjunto := TIdAttachmentFile.Create( Mensaje.MessageParts, sAdjunto );
end
else
Adjunto := nil;
try
SMTP.Connect;
except
raise Exception.Create( 'Error al conectar con el servidor.' );
end;
if SMTP.Connected then
begin
try
SMTP.Send( Mensaje );
except
raise Exception.Create( 'Error al enviar el mensaje.' );
end;
try
SMTP.Disconnect;
except
raise Exception.Create( 'Error al desconectar del servidor.' );
end;
end;
if Adjunto <> nil then
FreeAndNil( Adjunto );
FreeAndNil( Mensaje );
FreeAndNil( SMTP );
Application.MessageBox( 'Mensaje enviado correctamente.',
'Fin de proceso',MB_ICONINFORMATION );
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
EnviarMensaje( '[email protected]', 'corazon12', 'smtp.live.com',
'C:\Temp\CFDI26.xml', 'Te envio mi documento',
'[email protected]', 'Adjunto archivo: factura' );
end;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 06:28:21.


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