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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 19-11-2016
webmasterplc webmasterplc is offline
Miembro
 
Registrado: mar 2008
Posts: 274
Poder: 17
webmasterplc Va por buen camino
Error Al Enviar E-mail con Delphi (TAuthenticationType)

Buenos hace un tiempo rescate una funcion de internet, para enviar correos , la misma funciono perfecto en delphi 7 ahorita tengo xe8 y me saltan varios errores, he buscado en el club errores relacionados y nada
aqui esta el codigo y los errores

Código Delphi [-]
function enviarEmail (servidor : string; usuario : string; contrasena : string;
    puerto : integer; asunto : string; mensaje : TStringList; conAutenticacion : boolean;
    emisor : string; nombreEmisor : string; destinatario : string; cc : string) : boolean;
var
  compMensaje : TIdMessage;
  textoTemp : string;
  tipoAutenticacion : TAuthenticationType;
  envioCorrecto : boolean;
begin
  if conAutenticacion then
  begin
    compEnvioEmail.AuthenticationType := atLogin;
    compEnvioEmail.UserId := usuario;
    compEnvioEmail.Password := contrasena;
  end
  else
    compEnvioEmail.AuthenticationType := atNone;
  compMensaje := TIdMessage.Create (nil);
  compMensaje.From.Address := emisor;
  compMensaje.From.Name := nombreEmisor;
  compMensaje.Recipients.Add.Address := destinatario;
  compMensaje.CCList.Add.Address := cc;
  compMensaje.Body.AddStrings (mensaje);
  compMensaje.Subject := asunto;
  compMensaje.ReplyTo.Add.Address := emisor;
  envioCorrecto := true;
  try
    compEnvioEmail.Send(compMensaje);
  except
    envioCorrecto := false;
  end;
  compMensaje.Free;
  enviarEmail := envioCorrecto;
end;

errores

Cita:
[dcc32 Warning] UnitComunicaciones.pas(29): W1035 Return value of function 'ConectarServidorEmail' might be undefined
[dcc32 Error] UnitComunicaciones.pas(38): E2003 Undeclared identifier: 'TAuthenticationType'
[dcc32 Error] UnitComunicaciones.pas(43): E2003 Undeclared identifier: 'AuthenticationType'
[dcc32 Error] UnitComunicaciones.pas(43): E2003 Undeclared identifier: 'atLogin'
[dcc32 Error] UnitComunicaciones.pas(44): E2003 Undeclared identifier: 'UserId'
[dcc32 Error] UnitComunicaciones.pas(48): E2003 Undeclared identifier: 'AuthenticationType'
[dcc32 Error] UnitComunicaciones.pas(48): E2003 Undeclared identifier: 'atNone'
[dcc32 Fatal Error] Comercializacion.dpr(42): F2063 Could not compile used unit 'UnitComunicaciones.pas'

Última edición por dec fecha: 19-11-2016 a las 18:48:45. Razón: Poner etiqueta QUOTE a los errores
Responder Con Cita
  #2  
Antiguo 19-11-2016
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Poder: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Echa un vistazo a "compEnvioEmail". Si es del tipo "TIdSMTP", como creo que es, entonces en Indy 10 (la versión que incluye Delphi XE8) debes usar algo así:

Código Delphi [-]
IdSMTP1.AuthType := satNone;

O bien otro valor posible para "AuthType". Ya no existe "TAuthenticationType" sino que es "TIdSMTPAuthenticationType" que se encuentra declarado en la misma unidad "IdSMTP".
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Error al enviar e-mail con Indy Iuconlas Internet 0 02-03-2011 18:56:57
error al enviar mail Ricsato Internet 3 19-08-2008 02:55:50
Enviar mail Socket error #11004 monicasierrar Varios 0 08-03-2008 18:27:32
Error al enviar mail con archivo adjunto cbothamley Internet 0 08-12-2006 04:56:45
Error al enviar mail por NMSMTP Walterdf Internet 3 02-09-2003 14:43:37


La franja horaria es GMT +2. Ahora son las 18:08:56.


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