IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Lazarus Pascal Discussion :

Problème avec Laz_synape et smtpsend


Sujet :

Lazarus Pascal

  1. #1
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut Problème avec Laz_synape et smtpsend
    Bonjour à tous et bonne année.

    J'essaie d'envoyer des mails avec Laz_synapse.
    Je réussi à me connecter mais impossible d'envoyer le mail.
    J'ai smtpsend et ssl_openssl dans les uses.
    J'ai essayé plusieurs port, seul le port 587 permet de me connecté.
    J'ai essayé avec SMTP.Fullssl mais impossible.

    Je suis sous windows 11 et Lazarus 3.6.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
     
    function TForm1.CreationEnvoi(const User, Password, MailFrom, MailTo, SMTPHost, SMTPPort, MailData: string): boolean;
    var
      SMTP: TSMTPSend;
      sl: TStringList;
    begin
      Result := False;
      SMTP := TSMTPSend.Create;
      sl := TStringList.Create;
      try
        sl.Text := Maildata;
        SMTP.UserName := User;
        SMTP.Password := Password;
        SMTP.TargetHost := SMTPHost;
        SMTP.TargetPort := SMTPPort;
        smtp.StartTLS;
     
        if not SMTP.Login then
        begin
          ShowMessage('Connexion échouée...');
          SMTP.logout;
          SMTP.Free;
          exit;
        end;
     
        ShowMessage('Connection établie...');
     
        if (SMTP.MailFrom(MailFrom, Length(MailData))) and (SMTP.MailTo(MailTo)) and
          (SMTP.MailData(sl)) then Result := True;
     
      finally
        SMTP.logout;
        SMTP.Free;
        sl.Free;
     
        if Result then ShowMessage(' Envoi réussi... ')
        else
          ShowMessage('Envoi échoué');
      end;
     
    end;

  2. #2
    Membre extrêmement actif Avatar de Jon Shannow
    Homme Profil pro
    Responsable de service informatique
    Inscrit en
    Avril 2011
    Messages
    4 609
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Responsable de service informatique
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Avril 2011
    Messages : 4 609
    Points : 10 601
    Points
    10 601
    Par défaut
    Bonjour,

    Avez-vous regardé du coté de cette discussion ?

    JS
    Au nom du pèze, du fisc et du St Estephe
    Au nom du fric, on baisse son froc...

  3. #3
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    oui
    mon code est en parti fait à partir de cette discution

  4. #4
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    J'ai rajouter un affichage des erreurs
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
        if not (SMTP.MailFrom(MailFrom, 0))
        then
        begin
          Memo1.Append('SMTP ERROR: MailFrom:' + SMTP.EnhCodeString);
          Memo1.Append('-- Remote response: ' + SMTP.FullResult.Text);
        end
    retour:

    SMTP ERROR: MailFrom??-Other undefined Status
    -- Remote response:

  5. #5
    Expert confirmé
    Avatar de anapurna
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2002
    Messages
    3 462
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Mai 2002
    Messages : 3 462
    Points : 5 919
    Points
    5 919
    Par défaut
    Salut

    les librairies ssl sont bien installées sur les postes ?
    Nous souhaitons la vérité et nous trouvons qu'incertitude. [...]
    Nous sommes incapables de ne pas souhaiter la vérité et le bonheur, et sommes incapables ni de certitude ni de bonheur.
    Blaise Pascal
    PS : n'oubliez pas le tag

  6. #6
    Modérateur
    Avatar de tourlourou
    Homme Profil pro
    Biologiste ; Progr(amateur)
    Inscrit en
    Mars 2005
    Messages
    3 903
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Biologiste ; Progr(amateur)

    Informations forums :
    Inscription : Mars 2005
    Messages : 3 903
    Points : 11 473
    Points
    11 473
    Billets dans le blog
    6
    Par défaut
    Bonsoir,
    Pas de code erreur X.Y.Z retourné ?
    Delphi 5 Pro - Delphi 11.3 Alexandria Community Edition - CodeTyphon 6.90 sous Windows 10 ; CT 6.40 sous Ubuntu 18.04 (VM)
    . Ignorer la FAQ Delphi et les Cours et Tutoriels Delphi nuit gravement à notre code !

  7. #7
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    ssl_openssl installé

  8. #8
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    4 146
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 4 146
    Points : 9 723
    Points
    9 723
    Par défaut
    Hello,
    quel est le serveur smtp (si ce n'est pas confidentiel) ? comme par exemple avec gmail on avait l'option Autoriser les applications moins sécurisées quand le client SMTP n'était pas standard (outlook, thunderbird) et il peut y avoir des authentifications à plusieurs niveaux. Si tu as plusieurs comptes et plusieurs serveurs SMTP possibles essaie sur un autre.
    Ami calmant, J.P
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  9. #9
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    le serveur est mail.sematimo.com chez planethoster.
    il n'y a pas d'authentification à 2 niveaux

  10. #10
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    4 146
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 4 146
    Points : 9 723
    Points
    9 723
    Par défaut
    Hello,
    pour le TLS tu n'as pas mis les mêmes options que celles que j'employais en particulier AutoTLS.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
        SMTP.TargetPort := '587';
        SMTP.AutoTLS := True;
        SMTP.FullSSL := False;
    et pas de StartTLS

    Ami calmant, J.P
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  11. #11
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    j'utilise bien le port 587

    Si SMTP.AutoTLS := True;
    message "External: ACCESS violation"

    si smtp.StartTLS la connexion est établie mais l'email n'est pas envoyée

    j'ai libeay32.dll et ssleay32.dll dans le répertoire du projet

  12. #12
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    4 146
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 4 146
    Points : 9 723
    Points
    9 723
    Par défaut
    Hello,
    moi je n'utilise pas ces dll , je remets ce que j'ai dit dans la discussion dont il a le lien ici :
    Synapse utilise son propre fichier de gestion ssl ssl_openssl_lib.pas et voilà ce qu'on trouve dedans concernant les dlls à scruter :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    SSLLibNames: array[0..LibCount-1] of string = ( // OpenSSL v3.0
    {$IFDEF WIN64}
    'libssl-3-x64.dll',
    {$ELSE}
    'libssl-3.dll',
    {$ENDIF}
    // OpenSSL v1.1.x
    {$IFDEF WIN64}
    'libssl-1_1-x64.dll',
    {$ELSE}
    'libssl-1_1.dll',
    {$ENDIF}
    // OpenSSL v1.0.2 distinct names for x64 and x86
    {$IFDEF WIN64}
    'ssleay32-x64.dll',
    {$ELSE}
    'ssleay32-x86.dll',
    {$ENDIF}
    // OpenSSL v1.0.2
    'ssleay32.dll',
    // OpenSSL (ancient)
    'libssl32.dll'
    );
    CryptoLibNames: array[0..LibCount-1] of string = (
    // OpenSSL v3.0
    {$IFDEF WIN64}
    'libcrypto-3-x64.dll',
    {$ELSE}
    'libcrypto-3.dll',
    {$ENDIF}
    // OpenSSL v1.1.x
    {$IFDEF WIN64}
    'libcrypto-1_1-x64.dll',
    {$ELSE}
    'libcrypto-1_1.dll',
    {$ENDIF}
    // OpenSSL v1.0.2 distinct names for x64 and x86
    {$IFDEF WIN64}
    'libeay32-x64.dll',
    {$ELSE}
    'libeay32-x86.dll',
    {$ENDIF}
    // OpenSSL v1.0.2
    'libeay32.dll',
    // OpenSSL (ancient)
    'libeay32.dll'
    );
    {$ENDIF}

    moi je suis en Lazarus 64 bits donc sous windows ce sont les dll win64 qui se trouvent dans le répertoire Windows\system32 qui m'intéressent :
    Dans ce répertoire j'avais libssl-1_1-x64.dll et libcrypto-1_1-x64.dll et xmailer fonctionnait avec sur port 587
    J'ai téléchargé ici le fichier openssl-3.2.2-win64.zip et extrait les fichiers libssl-3-x64.dll et libcrypto-3-x64.dll que j'ai mis dans windows\system32 et j'ai renommé les anciens fichiers en 1.1 pour être sûr qu'ils ne soient pas utilisés. ça marche toujours pour xmailer.

    Ami calmant, J.P
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  13. #13
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    Bonjour

    J'ai installé libssl-3-x64.dll et libcrypto-3-x64.dll

    Maintenant j'ai cette erreur:

    ERROR: MailFrom: Permanent Failure-Other or undefined security status

  14. #14
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    4 146
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 4 146
    Points : 9 723
    Points
    9 723
    Par défaut
    Hello,
    l'adresse mail de l'expéditeur et celle du destinataire sont-elles correctes et aussi le reste du message (sujet, corps)?
    Permanent Security Failure Status A “Permanent Failure: Other or undefined security status” error indicates that the email could not be delivered because the recipient’s email system has flagged either the individual sender or the sending mail servers for security concerns or for suspicion of spam-related activity. This is a permanent issue, meaning that the problem is not likely to resolve itself without taking specific actions to address the security concerns.
    Here are some steps you can take to resolve this issue:

    1. Check SPF and DKIM Records: Ensure that your SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) records are correctly set up and valid. These records help verify the authenticity of your emails and can prevent them from being flagged as suspicious.
    2. Review Email Content: Examine the content of your emails to ensure they do not contain any elements that might trigger spam filters, such as excessive use of capital letters, too many links, or suspicious keywords.
    3. Improve Sender Reputation: Maintain a good sender reputation by sending emails only to recipients who have opted in and by ensuring your emails are relevant and valuable to the recipients.
    4. Contact the Recipient’s Email Provider: If the issue persists, you might need to contact the email provider of the recipient to understand the specific security policies that are causing the rejection and to request that your domain be whitelisted or approved.
    5. Use a Reputable Email Service Provider: Consider using a reputable email service provider that has established relationships with major email providers and can help improve your email deliverability.




    [/COLOR]
    Ami calmant, J.P
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  15. #15
    Membre averti
    Avatar de sematimo
    Profil pro
    Inscrit en
    Février 2009
    Messages
    326
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 326
    Points : 308
    Points
    308
    Par défaut
    les adresses mail sont correctes et le message aussi (très simple 4 mots)
    Une question, en cherchant sur internet, je vois
    tantôt
    "SMTP.MailFrom(MailFrom, Length(MailData))" ,

    tantôt
    "SMTP.MailFrom(MailFrom, Length(MaimFrom))"

    soit la longueur de from , soit la longueur du message ?

Discussions similaires

  1. [XL-2016] Problme avec opérateur OR
    Par Superpat9999 dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 26/07/2020, 14h57
  2. Problème avec la mémoire virtuelle
    Par Anonymous dans le forum CORBA
    Réponses: 13
    Dernier message: 16/04/2002, 17h10
  3. [Kylix] Runtime error 230 avec INDY
    Par Anonymous dans le forum EDI
    Réponses: 2
    Dernier message: 23/03/2002, 12h51
  4. Réponses: 2
    Dernier message: 21/03/2002, 00h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo