Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 09-03-2016
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is online now
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.056
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi 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( 'file_iscomop@hotmail.com', 'corazon12', 'smtp.live.com',
'C:\Temp\CFDI26.xml', 'Te envio mi documento',
'file_iscomp@hotmail.com', 'Adjunto archivo: factura' );
end;
Responder Con Cita
 



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 19:15:53.


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