Ver Mensaje Individual
  #1  
Antiguo 14-02-2022
pruz pruz is offline
Miembro
 
Registrado: sep 2003
Posts: 170
Reputación: 21
pruz Va por buen camino
Unhappy ERROR CORREO - not load ssl library

Buenas tardes amigo:

estoy haciendo un pequeña aplicacion de envio de correo por gmail.
pero me da el siguiente error "Could not load SSL library".

1.- Tengo las librerias libeay32.dll y ssleay32.dll en el mismo directorio del proyecto. (luego las cambie al windows\system32, pero dio el mismo erro). Baje las ultimas versiones del sitio https://indy.fulgan.com/SSL/, y probe con varias pero siempre el mismo error.

2.- Estoy usando Delphi 6 e Indy 10.0.

3.- Ya configure el gmail, para aceptar correo desde otras aplicacion.

4.- aqui va el codigo, si alguien me puede ayudar.



procedure TForm1.SendCorreo(Sender: TObject);
begin

//indySMTP es de tipo TIdSMTP (el icono es un buzon azul)
//mailMensaje es de tipo TIdMessage (el icono es un sobre)
//IdSSLIOHandlerSocket1 es un componente TIdSSLIOHandlerSocket (el icono es un candadito)


mailMensaje.Clear;
mailMensaje.From.Address := Trim(sUsuarioCorreo); //'tu_email@gmail.com';
mailMensaje.Subject := Trim(EdtAsunto.Text); //'Asunto';
mailMensaje.Body.SetText(MCuerpoCorreo.Lines.GetText); //cuerpo del mensaje
mailMensaje.From.Name := Trim(EdtQuien.Text); // 'Tu Nombre';

mailMensaje.Recipients.EMailAddresses := Trim(edtPara.Text) ; //'email_destino';

// TIdAttachment.Create(mailMensaje.MessageParts, Trim(edtAnexo.Text)) ;



//Configuracion parametros SSL
IdSSLIOHandlerSocket := TIdSSLIOHandlerSocketOpenSSL.Create(self);
IdSSLIOHandlerSocket.SSLOptions.Method := sslvSSLv23;
IdSSLIOHandlerSocket.SSLOptions.Mode := sslmClient;

IndySMTP.IOHandler := IdSSLIOHandlerSocket;
IndySMTP.UseTLS := utUseImplicitTLS;
IndySMTP.AuthType := atDefault;

IndySMTP.Host := sServidorCorreo; //servidor de envio smtp.gmail.com
IndySMTP.Port := StrToInt(sPuertoCorreo); //puerta 465
IndySMTP.Username := sUsuarioCorreo; //usuario xxxxx@gmail.com
IndySMTP.Password := sClaveCorreo; //password

indySMTP.Connect;

try
indySMTP.Authenticate;

if indySmtp.Connected then begin
indySMTP.Send(mailMensaje);
try
showmessage('El mensaje se envió correctamente');
except
showmessage('Error al enviar correo');

serror := 1;

end;
end else begin
showmessage('Error en la Conexion o el Servicio.');
serror := 2;
end;
except
showmessage('Se produjo un fallo durante el envío del mensaje');
serror := 3;

end;
if indySMTP.Connected then
indySMTP.Disconnect;

end;


Gracias,
Patricio
Responder Con Cita