0

Estoy haciendo pruebas para enviar por phpmailer correos, usando el endpoint de AWS SES, en localhost me funciona, pero en el servidor montado sobre Ubuntu da error, alguien le ha pasado algo similar? agradezco cualquier ayuda, gracias de antemano.

Este es el error con la opcion $mail->SMTPDebug = true;

Connection: opening to ssl://email-smtp.us-east-1.amazonaws.com:465, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ), ) 2019-10-18 12:15:29 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): SSL: Handshake timed out 2019-10-18 12:15:29 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): Failed to enable crypto 2019-10-18 12:15:29 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://email-smtp.us-east-1.amazonaws.com:465 (Unknown error) 2019-10-18 12:15:29 SMTP ERROR: Failed to connect to server: (0) 2019-10-18 12:15:29 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Cuando uso tls me da este error:

2019-10-18 12:58:39 Connection: opening to email-smtp.us-east-1.amazonaws.com:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ), ) 2019-10-18 12:58:39 Connection: opened 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "" 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-1LXKVIWE0 JXenCeX6eVnvJGrwZy7l " 2019-10-18 12:58:39 SERVER -> CLIENT: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-1LXKVIWE0 JXenCeX6eVnvJGrwZy7l 2019-10-18 12:58:39 CLIENT -> SERVER: EHLO 172.30.222.76 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "" 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250-email-smtp.amazonaws.com " 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "250-email-smtp.amazonaws.com " 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250-8BITMIME " 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "250-email-smtp.amazonaws.com 250-8BITMIME " 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250-SIZE 10485760 " 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 " 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250-STARTTLS " 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS " 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN " 2019-10-18 12:58:39 SMTP -> get_lines(): $data is "250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS 250-AUTH PLAIN LOGIN " 2019-10-18 12:58:39 SMTP -> get_lines(): $str is "250 Ok " 2019-10-18 12:58:39 SERVER -> CLIENT: 250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS 250-AUTH PLAIN LOGIN 250 Ok 2019-10-18 12:58:39 CLIENT -> SERVER: STARTTLS 2019-10-18 12:58:40 SMTP -> get_lines(): $data is "" 2019-10-18 12:58:40 SMTP -> get_lines(): $str is "220 Ready to start TLS " 2019-10-18 12:58:40 SERVER -> CLIENT: 220 Ready to start TLS 2019-10-18 13:03:40 SMTP Error: Could not connect to SMTP host. 2019-10-18 13:03:40 CLIENT -> SERVER: QUIT 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $data is "" 2019-10-18 13:03:40 SMTP -> get_lines(): $str is "" 2019-10-1

3
  • ya abriste los puertos en el security group 25 / 587 / 2587 , o con TLS => 465 / 2465 , hace mucho tuvimos un error similar y aunque teniamos el 587 habilitado en el SG faltaba el 25 que es el default de SMTP ( Igual en local todo funcionaba ) Commented el 21 oct. 2019 a las 21:15
  • No he intentado eso, pero usando en endpoint de gmail en el servidor todo corre bien, cuando cambio a el de AWS con SES, en local va bien, hasta en una instancia de AWS tambien va bien, pero en nuestro servidor actual de produccion sobre Ubuntu 16.04.2 LTS da ese error que muestro, probare eso que indicas, muchas gracias
    – Daniel
    Commented el 22 oct. 2019 a las 18:50
  • ejecute el comando cat /etc/services y esta corriendo ese servicios smtp 25/tcp mail
    – Daniel
    Commented el 22 oct. 2019 a las 19:19

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.