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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19/11/2016
webmasterplc webmasterplc is offline
Miembro
 
Join Date: Mar 2008
Posts: 277
Poder: 19
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

Quote:
[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'

Last edited by dec : 19/11/2016 at 18:48. Reason: Poner etiqueta QUOTE a los errores
Reply With Quote
  #2  
Old 19/11/2016
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,

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
Reply With Quote
Reply



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error al enviar e-mail con Indy Iuconlas Internet 0 02/03/2011 18:56
error al enviar mail Ricsato Internet 3 19/08/2008 02:55
Enviar mail Socket error #11004 monicasierrar Varios 0 08/03/2008 18:27
Error al enviar mail con archivo adjunto cbothamley Internet 0 08/12/2006 04:56
Error al enviar mail por NMSMTP Walterdf Internet 3 02/09/2003 14:43


All times are GMT +2. The time now is 00:09.


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