Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Varios
Register FAQ Members List Calendar Guía de estilo Today's Posts

Coloboración Paypal con ClubDelphi

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12/03/2013
yn4v4s yn4v4s is offline
Miembro
NULL
 
Join Date: May 2012
Posts: 33
Poder: 0
yn4v4s Va por buen camino
Problema con librerias SSL al enviar email

Hola a todos, estoy desarrollando una App que envia un email a mi cuenta de correo (GMail), y utilize el siguiente codigo:


procedure TForm1.btnConnectClick(Sender: TObject);
var

SMTP: TIdSMTP;
Mail: TIdMessage;


begin

IdSMTP_SendMail := TIdSMTP.Create(Self);

with IdSMTP_SendMail do begin
IoHandler:=SSLIOHandler;
AuthType := satDefault;
Host := 'smtp.gmail.com';
port := 465 ;
useTLS:=utUseExplicitTLS;
Username := mi_cuenta;
Password := mi_password;
end;

mail := TIdMessage.Create(Self);
with mail do begin
From.Address := mi_cuenta;
Recipients.EMailAddresses := cuenta_del_destinatario;
Subject := 'Hola';
body.Text := 'Esto es una prueba';
end;


IdSMTP_SendMail.Connect;


IdSMTP_SendMail.Send(mail);

end;

//---------------------------------------------

La App me da la siguiente excepcion:

First chance exception at $75244B32. Exception class EIdOSSLCouldNotLoadSSLLibrary with message 'Could not load SSL library.'. Process Project1.exe (3360)

He descargado e instalado las siguientes librerias:

"libeay32.dll", "libSSL32.dll" y "ssleay32.dll", "MSVCR100.dll" y "VSINIT.dll"

Las copie en C:\Windows\SysWOW64 ya que tengo Win8 x64.

Uso el Embarcadero RAD Studio 2010 y Indy v10.5.5

Agradeceria mucho su ayuda... 1000 Gracias
Reply With Quote
  #2  
Old 13/03/2013
Casimiro Noteví's Avatar
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Join Date: Sep 2004
Location: En algún lugar.
Posts: 32,681
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Recuerda poner los tags al código fuente, ejemplo:



Gracias
Reply With Quote
  #3  
Old 13/03/2013
yn4v4s yn4v4s is offline
Miembro
NULL
 
Join Date: May 2012
Posts: 33
Poder: 0
yn4v4s Va por buen camino
con tap

Código Delphi [-]
procedure TForm1.btnConnectClick(Sender: TObject);
var

  SMTP: TIdSMTP;
  Mail: TIdMessage;


begin

IdSMTP_SendMail := TIdSMTP.Create(Self);

with IdSMTP_SendMail do begin
IoHandler:=SSLIOHandler;
AuthType := satDefault;
Host := 'smtp.gmail.com';
port := 465 ;
useTLS:=utUseExplicitTLS;
Username := mi_cuenta;
Password := mi_password;
end;

mail := TIdMessage.Create(Self);
with mail do begin
From.Address := mi_cuenta;
Recipients.EMailAddresses := cuenta_del_destinatario;
Subject := 'Hola';
body.Text := 'Esto es una prueba';
end;


IdSMTP_SendMail.Connect;


IdSMTP_SendMail.Send(mail);

end;
Reply With Quote
  #4  
Old 13/03/2013
nlsgarcia's Avatar
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Join Date: Feb 2007
Location: Caracas, Venezuela
Posts: 2,206
Poder: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
yn4v4s,

Quote:
...estoy desarrollando una App que envia un email a mi cuenta de correo (GMail)...
Revisa este código:
Código Delphi [-]
procedure TfrmPrincipal.btnEnviarEmailClick(Sender: TObject);
begin
  with IdMessage do
  begin
    Body.Clear();
    Recipients.Clear();
    Sender.Address := edEmailRemitente.Text;
    Recipients.EMailAddresses := edEmailDestinatario.Text;
    Subject := edAsuntoEmail.Text;
    Body.AddStrings(mCuerpoEmail.Lines);
  end;

  with IdSMTP do
  begin
    IOHandler := IdSSLIOHandlerSocket;
    IdSSLIOHandlerSocket.SSLOptions.Method := sslvSSLv23; // sslv : SSLv2, SSLv3, TLSv1, SSLv23.
    IdSSLIOHandlerSocket.SSLOptions.Mode := sslmUnassigned;
    IdSSLIOHandlerSocket.SSLOptions.VerifyMode := [];
    IdSSLIOHandlerSocket.SSLOptions.VerifyDepth := 0;
    Port := 465;
    Host := edServidorSmtp.Text;
    AuthenticationType := atLogin;
    Username := edNombreUsuario.Text;
    Password := edContrasenaUsuario.Text;
    try
       Connect(5000);
    except
       ShowMessage('Error de conexión');
    end;

    btnEnviarEmail.Enabled := false;
    try
      Send(IdMessage);
      ShowMessage('Correo enviado con éxito');
    finally
      btnEnviarEmail.Enabled := true;
    end;

    if Connected then
      Disconnect();
  end;
end;
El código anterior permite enviar emails usando Gmail como Mail Server por medio de Delphi 7, Indy 9 y openssl096. Quizás funcione correctamente en Delphi 2010 y Indy v10.5.5

Las Dlls Indy openssl096 están disponibles en el link : http://indy.fulgan.com/SSL/Archive/

El código anterior y sus Dlls esta disponible en el link: http://terawiki.clubdelphi.com/Delph...Mail+Gmail.rar

Espero sea útil

Nelson.
Reply With Quote
  #5  
Old 13/03/2013
yn4v4s yn4v4s is offline
Miembro
NULL
 
Join Date: May 2012
Posts: 33
Poder: 0
yn4v4s Va por buen camino
gracias hermano voy a probar
Reply With Quote
  #6  
Old 13/03/2013
yn4v4s yn4v4s is offline
Miembro
NULL
 
Join Date: May 2012
Posts: 33
Poder: 0
yn4v4s Va por buen camino
funciono perfecto, gracias hermano.
Reply With Quote
  #7  
Old 13/03/2013
yn4v4s yn4v4s is offline
Miembro
NULL
 
Join Date: May 2012
Posts: 33
Poder: 0
yn4v4s Va por buen camino
Unhappy No funciona con Indy 10.5.5

Hola, el problema es el siguiente:

El componente IdSSLIOHandlerSocket no existe en Delphi 2010 (Indy 10.5.5) en cambio tube que sustituirlo por un IdSSLIOHandlerSocketOpenSSL en el cual la propiedad AuthenticationType ha cambiado a AuthType y atLogin no se ve por ninguna parte, ahora quedaria de la siguiente manera:

Código Delphi [-]
AuthType := satSASL;

1ero: Al enviar recibo la misma excepcion "Could not load SSL Library", luego de esto me he descargado el archivo openssl-1.0.1e-i386-win32.zip desde http://indy.fulgan.com/SSL/ con lo que ya no me pide dicha libreria, pero ahora el programa se cuelga al enviar.

Agradeceria que me ayudaran...
Reply With Quote
  #8  
Old 14/03/2013
nlsgarcia's Avatar
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Join Date: Feb 2007
Location: Caracas, Venezuela
Posts: 2,206
Poder: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
yn4v4s,

Quote:
Originally Posted by yn4v4s
...No funciona con Indy 10.5.5...
Revisa el Msg #24 de este link:
Espero sea útil

Nelson.
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
Problema al enviar un email con acentos en Delphi 2009 Quim Herrera Internet 2 18/01/2012 16:43
Problema con Formato de texto al enviar un email m.ruiz Varios 2 07/11/2007 12:59
Problema al Enviar EMAIL con Indys AGAG4 Internet 1 05/04/2006 17:59
Problema para enviar email con indy delphi7 cmena Internet 2 13/10/2005 21:58
Problema al enviar Email con adjuntos usando el componente Idsmtp de las indy Nbull Internet 2 22/11/2004 09:23


All times are GMT +2. The time now is 05:46.


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