Page 1 sur 1

Configuration smtp o365

Posté : mar. 24 juil. 2018 09:42
par wolzi
Bonjour,

Etant en pleine configuration de Gestsup, je rencontre un problème lors de la configuration du smtp.
Nous utilisons office 365 pour nos mails.

Voici l'erreur que je recontre :

SMTP SERVER:
2018-07-24 07:34:50 Connection: opening to ssl://smtp.office365.com:587, timeout=300, options=array()
2018-07-24 07:34:50 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 [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 07:34:50 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 07:34:50 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 07:34:50 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

( ! ) Fatal error: Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1726
( ! ) PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1726
Call Stack
# Time Memory Function Location
1 0.0001 413656 {main}( ) ...\index.php:0
2 0.0312 516512 include( 'C:\wamp64\www\preview_mail.php' ) ...\index.php:884
3 0.0316 523712 require( 'C:\wamp64\www\core\mail.php' ) ...\preview_mail.php:27
4 0.0346 617192 PHPMailer\PHPMailer\PHPMailer->send( ) ...\mail.php:476


J'ai utilisé la configuration suivante :

Smtp : smtp.office365.com
Port smtp : 587
SSL : Activée
Préfixe smtp : ssl//
classe smtp : IsSMTP
Serveur smtp authentifié : Oui



Merci d'avance pour vos réponses.

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 11:29
par Flox
Bonjour,

pouvez vous faire un impression écran de votre page système ?

Cdt

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 11:44
par wolzi
Voici ma page systeme

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 13:18
par Flox
Pouvez vous passer en dernière version stable 3.1.32 et refaire un test

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 15:31
par wolzi
Merci de votre aide Flox,

Je viens de faire la maj 3.1.30 => 3.1.32 et je rencontre un message d'erreur similaire.


SMTP SERVER:
2018-07-24 13:30:19 Connection: opening to ssl://smtp.office365.com:587, timeout=300, options=array()
2018-07-24 13:30:19 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 [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 13:30:19 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 13:30:19 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 325]
2018-07-24 13:30:19 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting

( ! ) Fatal error: Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1726
( ! ) PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1726
Call Stack
# Time Memory Function Location
1 0.0001 413192 {main}( ) ...\index.php:0
2 0.0207 516120 include( 'C:\wamp64\www\preview_mail.php' ) ...\index.php:889
3 0.0217 523832 require( 'C:\wamp64\www\core\mail.php' ) ...\preview_mail.php:27
4 0.1188 655440 PHPMailer\PHPMailer\PHPMailer->send( ) ...\mail.php:540



------

Je viens de retester en modifiant des paramètres notamment le prefixe smtp en tls//. Je rencontre une erreur de ce type.


SMTP SERVER:
2018-07-24 13:32:05 Connection: opening to smtp.office365.com:587, timeout=300, options=array()
2018-07-24 13:32:05 Connection: opened
2018-07-24 13:32:05 SMTP INBOUND: "220 VI1PR08CA0204.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 24 Jul 2018 13:32:04 +0000"
2018-07-24 13:32:05 SERVER -> CLIENT: 220 VI1PR08CA0204.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 24 Jul 2018 13:32:04 +0000
2018-07-24 13:32:05 CLIENT -> SERVER: EHLO localhost
2018-07-24 13:32:05 SMTP INBOUND: "250-VI1PR08CA0204.outlook.office365.com Hello [217.69.24.251]"
2018-07-24 13:32:05 SMTP INBOUND: "250-SIZE 157286400"
2018-07-24 13:32:05 SMTP INBOUND: "250-PIPELINING"
2018-07-24 13:32:05 SMTP INBOUND: "250-DSN"
2018-07-24 13:32:05 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2018-07-24 13:32:05 SMTP INBOUND: "250-STARTTLS"
2018-07-24 13:32:05 SMTP INBOUND: "250-8BITMIME"
2018-07-24 13:32:05 SMTP INBOUND: "250-BINARYMIME"
2018-07-24 13:32:05 SMTP INBOUND: "250-CHUNKING"
2018-07-24 13:32:05 SMTP INBOUND: "250 SMTPUTF8"
2018-07-24 13:32:05 SERVER -> CLIENT: 250-VI1PR08CA0204.outlook.office365.com Hello [217.69.24.251]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2018-07-24 13:32:05 CLIENT -> SERVER: STARTTLS
2018-07-24 13:32:05 SMTP INBOUND: "220 2.0.0 SMTP server ready"
2018-07-24 13:32:05 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2018-07-24 13:32:20 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [C:\wamp64\www\components\PHPMailer\src\SMTP.php line 404]
SMTP Error: Could not connect to SMTP host.
2018-07-24 13:32:20 CLIENT -> SERVER: QUIT
2018-07-24 13:32:20 SMTP INBOUND: ""
2018-07-24 13:32:20 SERVER -> CLIENT:
2018-07-24 13:32:20 SMTP ERROR: QUIT command failed:
2018-07-24 13:32:20 Connection: closed
SMTP Error: Could not connect to SMTP host.

( ! ) Fatal error: Uncaught PHPMailer\PHPMailer\Exception: SMTP Error: Could not connect to SMTP host. in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1898
( ! ) PHPMailer\PHPMailer\Exception: SMTP Error: Could not connect to SMTP host. in C:\wamp64\www\components\PHPMailer\src\PHPMailer.php on line 1898
Call Stack
# Time Memory Function Location
1 0.0001 413192 {main}( ) ...\index.php:0
2 0.0206 516120 include( 'C:\wamp64\www\preview_mail.php' ) ...\index.php:889
3 0.0216 523832 require( 'C:\wamp64\www\core\mail.php' ) ...\preview_mail.php:27
4 0.0256 588640 PHPMailer\PHPMailer\PHPMailer->send( ) ...\mail.php:540

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 16:24
par Flox
Avez vous essayer de désactiver la verification SSL ?

Re: Configuration smtp o365

Posté : mar. 24 juil. 2018 16:52
par wolzi
Effectivement c'est une option que je n'avais pas désactivée.
Tout est fonctionnel.
Merci de votre aide