Email PRO OVH qui ne fonctionne pas

32284
,

Bonjour,

Lors de notre achat de domaine nous avions reçu une offre d'email supplémentaire, ensuite n'ayant plus cela nous avons pris une offre Email PRO. L'email est fonctionnel sur le webmail OVH (nous pouvons recevoir et envoyer des messages) cependant avec les mêmes coordonnées qu'avant ; nous avons un message : " SMTP ERROR: Password command failed: 535 5.7.1 Authentication failed ". Nous utilisons : SSL0.OVH.NET et le port 465.

Le code PHP reste identique et de même pour le mot de passe à l'époque où ça fonctionnait :

public static function send($destinataire, $sujet, $message_txt, $message_html, $unsubscribe = '')
    {
        try{    
            $mail = new PHPMailer(true);                              
            $mail->SMTPDebug = 3;
            $mail->isSMTP();                        
            $mail->Host = 'SSL0.OVH.NET';

            $mail->SMTPAuth = true;                              
            $mail->Username = 'contact@frozenia.fr';                 
            $mail->Password = 'MOT_DE_PASSE';                     
            $mail->SMTPSecure = 'ssl';                           
            $mail->Port = 465; 

            $mail->DKIM_domain = 'frozenia.fr';
            $mail->DKIM_private = '/home/frozenia/froz_web/class/dkim.private.key';
            $mail->DKIM_selector = 'default';
            $mail->DKIM_passphrase = '';
            $mail->DKIM_identity = $mail->Username;

            $mail->setFrom('contact@frozenia.fr', 'Frozenia');
            $mail->addAddress($destinataire);


            if (!empty($unsubscribe)) {
                $mail->addCustomHeader("List-Unsubscribe",'<contact@frozenia.fr>, <' . $unsubscribe . '>');
            }

            $mail->CharSet = 'UTF-8';   

            $mail->isHTML(true);                                
            $mail->Subject = $sujet;
            $mail->Body    = $message_html;
            $mail->AltBody = $message_txt;

            $mail->send();
            return true;
        } catch (Exception $e) {
            return $e;
        }
    }

Voici le code d'erreur :

2018-11-16 20:12:29 Connection: opening to ssl://SSL0.OVH.NET:465, timeout=300, options=array()
2018-11-16 20:12:29 Connection: opened
2018-11-16 20:12:29 SERVER -> CLIENT: 220 GARM-105G006 Friday, November 16, 2018
2018-11-16 20:12:29 CLIENT -> SERVER: EHLO www.frozenia.fr
2018-11-16 20:12:29 SERVER -> CLIENT: 250-OVH SMTP PROXY Hello250-SIZE 104857600250-ENHANCEDSTATUSCODES250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250 8BITMIME
2018-11-16 20:12:29 CLIENT -> SERVER: AUTH LOGIN
2018-11-16 20:12:29 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2018-11-16 20:12:29 CLIENT -> SERVER: <credentials hidden>
2018-11-16 20:12:29 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2018-11-16 20:12:29 CLIENT -> SERVER: <credentials hidden>
2018-11-16 20:12:29 SERVER -> CLIENT: 535 5.7.1 Authentication failed
2018-11-16 20:12:29 SMTP ERROR: Password command failed: 535 5.7.1 Authentication failed
SMTP Error: Could not authenticate.
2018-11-16 20:12:29 CLIENT -> SERVER: QUIT
2018-11-16 20:12:39 SERVER -> CLIENT: 221 www.frozenia.fr Service closing transmission channel
2018-11-16 20:12:39 Connection: closed
SMTP Error: Could not authenticate.
PHPMailer\PHPMailer\Exception Object
(
    [message:protected] => SMTP Error: Could not authenticate.
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /home/frozenia/froz_web/class/PHPMailer/PHPMailer.php
    [line:protected] => 1911
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /home/frozenia/froz_web/class/PHPMailer/PHPMailer.php
                    [line] => 1725
                    [function] => smtpConnect
                    [class] => PHPMailer\PHPMailer\PHPMailer
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [1] => Array
                (
                    [file] => /home/frozenia/froz_web/class/PHPMailer/PHPMailer.php
                    [line] => 1481
                    [function] => smtpSend
                    [class] => PHPMailer\PHPMailer\PHPMailer
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Date: Fri, 16 Nov 2018 21:12:29 +0100
To: Dylan3250@hotmail.com
From: Frozenia 
Subject: =?UTF-8?Q?R=C3=A9cup=C3=A9ration_du_mot_de_passe?=
Message-ID: 
X-Mailer: PHPMailer 6.0.5 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_XfMYNcUIFBGxQ9UT0M0quizBMy0Zr4PTiPrGs2pfM"
Content-Transfer-Encoding: 8bit
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=301; s=default;
    t=1542399149; c=relaxed/simple;
    h=From:To:Date:Subject;
    d=frozenia.fr; i=contact@frozenia.fr;
    z=From:=20Frozenia=20
    |To:=20Dylan3250@hotmail.com
    |Date:=20Fri,=2016=20Nov=202018=2021:12:29=20+0100
    |Subject:=20=3D?UTF-8?Q?R=3DC3=3DA9cup=3DC3=3DA9ration_du_mot_de_passe?=3D;
    bh=F6BVL1GsSu1CO/R9EBniW6fCTMeogI5/PRnrqGitMFY=;
    b=yWA9SO5jF/ggeZUWr7I3veIUmA9e/WbvMPliW0jIhumo+tgSAT9fWgV1NThTzhpMLcjhaXJgHdYpZ8Ye4ZMBL9ZR6vjdWKQDETxbfhjdwbL+q9deBJpL7JfHAzIuMzfBADjqcc6m+Z0AJSLZwpPe5KY7uLcteeOuZbCRKGyNrVc=


                            [1] => This is a multi-part message in MIME format.
--b1_XfMYNcUIFBGxQ9UT0M0quizBMy0Zr4PTiPrGs2pfM
Content-Type: text/plain; charset=us-ascii

ezez

--b1_XfMYNcUIFBGxQ9UT0M0quizBMy0Zr4PTiPrGs2pfM
Content-Type: text/html; charset=us-ascii

zezz


--b1_XfMYNcUIFBGxQ9UT0M0quizBMy0Zr4PTiPrGs2pfM--

                        )

                )

            [2] => Array
                (
                    [file] => /home/frozenia/froz_web/class/PHPMailer/PHPMailer.php
                    [line] => 1320
                    [function] => postSend
                    [class] => PHPMailer\PHPMailer\PHPMailer
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [3] => Array
                (
                    [file] => /home/frozenia/froz_web/class/ClassGenMail.php
                    [line] => 47
                    [function] => send
                    [class] => PHPMailer\PHPMailer\PHPMailer
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [4] => Array
                (
                    [file] => /home/frozenia/froz_web/pages/perdu.php
                    [line] => 79
                    [function] => send
                    [class] => GenMail
                    [type] => ::
                    [args] => Array
                        (
                            [0] => Dylan3250@hotmail.com
                            [1] => Récupération du mot de passe
                            [2] => ezez
                            [3] => zezz
                        )

                )

            [5] => Array
                (
                    [file] => /home/frozenia/froz_web/templates/router.php
                    [line] => 152
                    [args] => Array
                        (
                            [0] => /home/frozenia/froz_web/pages/perdu.php
                        )

                    [function] => require
                )

            [6] => Array
                (
                    [file] => /home/frozenia/froz_web/index.php
                    [line] => 291
                    [args] => Array
                        (
                            [0] => /home/frozenia/froz_web/templates/router.php
                        )

                    [function] => require
                )

        )

    [previous:Exception:private] => 
)

3 Réponse

17162
,

Bonsoir.
Probablement une erreur de votre part concernant la configuration au serveur.
Car en regardant la documentation d'OVH concernant l'offre Email Pro, pour commencer il n'y a pas de port 465 de disponible, seulement le port 587 pour les emails sortants, ensuite pour ce qui est de l'addresse du serveur, ce serait plutôt pro1.mail.ovh.net.

32284
,

Avec ceci j'obitens ces erreurs :

2018-11-17 00:23:14 Connection: opening to ssl://pro1.mail.ovh.net:587, timeout=300, options=array()
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F10B:SSL routines:ssl3_get_record:wrong version number [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://pro1.mail.ovh.net:587 (Unknown error) [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
2018-11-17 00:23:14 Connection: opening to ssl://pro1.mail.ovh.net:587, timeout=300, options=array()
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F10B:SSL routines:ssl3_get_record:wrong version number [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://pro1.mail.ovh.net:587 (Unknown error) [/home/frozenia/froz_web/class/PHPMailer/SMTP.php line 325]
2018-11-17 00:23:14 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Merci d'avance !

32284
,

Problème réglé y'a pas de SSL ;)