-5

I wrote a program to send email in delphi xe3 , and it works fine , when I copy the program to another computer (windows 8) it works fine but on Computer (Windows 7) the stmp.send did not respond Unless I install embarcadero on it .I Think the problem is in the files libeay32.dll and ssleay32.dll Here is the code

var
  SMTP: TIdSMTP;
  Email: TIdMessage;
  SSLHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
  SMTP := TIdSMTP.Create(nil);
  Email := TIdMessage.Create(nil);
  SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);

  try
    SSLHandler.MaxLineAction := maException;
    SSLHandler.SSLOptions.Method := sslvTLSv1;
    SSLHandler.SSLOptions.Mode := sslmUnassigned;
    SSLHandler.SSLOptions.VerifyMode := [];
    SSLHandler.SSLOptions.VerifyDepth := 0;
    SMTP.IOHandler := SSLHandler;

    SMTP.Host := 'smtp.gmail.com';
    SMTP.Username := 'Username@gmail.com';
    SMTP.UseTLS := utUseExplicitTLS;
    SMTP.Port := 587;

    SMTP.Password := 'Password';
    SMTP.Connect;
    Email.Clear;
    Email.AttachmentEncoding:='MIME' ;
    Email.IsEncoded      := true;
    Email.Charset        := 'utf-8';
    Email.ContentType    :='multipart/alternative';
    Email.Encoding        := meMime;
    Email.UseNowForDate  := true;

    Email.From.Address :=  'Address' ;
    Email.Recipients.EmailAddresses := 'Recipients';
    Email.Subject := 'Subject';
    Email.Body.Text :='Body'  ;
    SMTP.Send(Email);
    SMTP.Disconnect;

    except on E:Exception do
      Button1.Caption:=E.Message;
      end;
    SMTP.Free;
    Email.Free;
    SSLHandler.Free;
  end;

Any idea Thanks

  • 1
    This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself. – Oldskool May 30 '14 at 23:10
  • Welcome to StackOverflow. Please read the guidelines for how to ask good questions. As this one stands, it is not answerable, as there is not enough information to know what is going on. – Remy Lebeau May 30 '14 at 23:55

1 Answers1

0

The files libeay32.dll and ssleay32.dll are needed by the executable. Place them in the same folder as the executable and it should work, even when you don't install Delphi on the target computer.

Birger
  • 4,343
  • 21
  • 35