Ver Mensaje Individual
  #1  
Antiguo 19-11-2016
webmasterplc webmasterplc is offline
Miembro
 
Registrado: mar 2008
Posts: 275
Reputación: 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