Einzelnen Beitrag anzeigen

Caps

Registriert seit: 23. Mär 2006
Ort: Leipzig
299 Beiträge
 
#4

AW: "Could not load SSL library" (D2007, Indy10, OpenSSL?)

  Alt 28. Feb 2014, 11:30
Die DLLs kannst Du von hier laden.
Dann würde ich die neueste (32bit) verwenden.
Wo hast Du denn die DLLs abgelegt?

Grüße
Klaus
Ich habe mir die openssl-1.0.1f-i386-win32.zip gezogen und die beiden DLLs in das Projektverzeichnis gelegt. Trotzdem kommt die Meldung "Could not load SSL library".

Meine Senderoutine sieht so aus:
Delphi-Quellcode:
  function PostMock(ASource: TIdStrings): String;
  var
     MailMessage: TIdMessage;
     _receiver,
     _subject,
     _bodycontent: String;
  begin
    // Wenn cbSSLMails gecheckt ist, dann wird die Mail mit SSL verschickt.

    with Form1 do begin
      IdSMTP1.Host := mail_host;
      IdSMTP1.Port := StrToInt(mail_port);
      IdSMTP1.Username := {Benutzername};
      IdSMTP1.Password := {Passwort};

      _receiver := ASource.Values ['receiver'];
      _subject := ASource.Values ['subject'];
      _bodycontent := ASource.Values ['bodycontent'];

      if cbSSLMails.Checked then begin // SSL konfigurieren
        with IdSSLIOHandlerSocketOpenSSL1 do begin
          MaxLineAction := maException;
          with SSLOptions do begin
            Method := sslvSSLv3;//sslvTLSv1;
            Mode := sslmUnassigned;
            VerifyMode := [];
            VerifyDepth := 0;
            PassThrough := false;
          end;
        end;
        IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
        IdSMTP1.UseTLS := utUseImplicitTLS; // für Port 465 (bereits das Greeting ist verschlüsselt)
      end;

      MailMessage := TIdMessage.Create(nil);
      try
        with MailMessage do begin
          Recipients.Clear;
          From.Name := {From-Name};
          From.Address := IdSMTP1.Username;
          ReplyTo.EMailAddresses := {Adresse};
          Recipients.EMailAddresses := _receiver;
          Date := now;
          Subject := _subject;
          Body.Text := _bodycontent;
        end;

        IdSMTP1.AuthType := atDefault;//atDefault; // (atNone, atDefault, atSASL) // atDefault ist wahrscheinlich atLogin
        IdSMTP1.Connect;
        Fred.MailSent := false;
        IdSMTP1.Send(MailMessage);
        Repeat
          Application.ProcessMessages;
        until Fred.MailSent;
        if IdSMTP1.Connected then IdSMTP1.Disconnect;
        FreeAndNil(MailMessage);
        Result := 'Success';
      except on e: Exception do begin
        FreeAndNil(MailMessage);
        Result := 'Mail delivery failed ('+e.Message+').';
      end;
      end;
    end;
  end;
Hm... (?)
lg Caps
"Der Mode cmCFS8 ist prohibitär und von mir entwickelt."
  Mit Zitat antworten Zitat