frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Vesta email error

inshainsha Member
edited November 2016 in Feature Request/Bug Report
After i installed VestaCP from time4vps billing i have working email.
But after i install it on fresh centos 6 vestacp with nginx+php-fpm i get error in sending mails from web.

get this error from my web:

Unknown error type: [2] stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed on /home/admin/web/DOMAIN/public_html/includes/packages/PHPMailer/class.smtp.php line 344
My NOTICE [1024] ---->PHPMailer error: SMTP Error: Could not connect to SMTP host.
on /home/admin/web/DOMAIN/public_html/includes/class_email_handler.php line 500

Can you help me fix this or try to setup your VestaCP installation with http://www.tpweb.org/2015/11/26/vestacp-upgrade-instructions-apache-php-fpm-centos/

Comments

  • Hello,

    could you clarify why you do not want to use our working VestaCP OS template?
  • Hello, i didnt use it because by default installs apache + nginx. And i needed nginx + php-fpm. I installed manually and fixed certificate problems.
  • Glad you managed to solve the issue. Could you provide us with a solution as well?
  • Hello, here is a solution https://forum.vestacp.com/viewtopic.php?f=10&t=12617&p=50074
    Only if you create new OS for VestaCP with nginx + php-fpm
  • inshainsha Member
    edited November 2016
    Sorry, can you delete this post? I used my domain name DOMAIN
  • We would like to leave it for future reference if you do not mind.

    Regarding your request we have changed your domain to "DOMAIN".
  • It seems like you're encountering an issue with SSL/TLS verification when trying to send emails from your web application using PHPMailer on a VestaCP server with CentOS 6, nginx, and PHP-FPM. Here are some steps you can take to troubleshoot and potentially fix this issue:

    1. Check SSL Certificate Verification

    • The error message SSL3_GET_SERVER_CERTIFICATE:certificate verify failed indicates that PHPMailer is unable to verify the SSL certificate presented by the SMTP server.
    • Verify if the SMTP server's SSL certificate is valid and trusted. You may need to update the CA certificates on your server.

    2. Update CA Certificates

    • Install or update the CA certificates bundle on your CentOS 6 server. This ensures that PHP's OpenSSL library can verify SSL certificates correctly.
    • On CentOS 6, you can update CA certificates using:
      bash yum install ca-certificates update-ca-trust

    3. Configure PHPMailer for SMTP

    • Ensure that PHPMailer is configured correctly in your application (class_email_handler.php in your case).
    • Check the SMTP settings (host, port, encryption method) to ensure they match the configuration provided by your SMTP server provider (e.g., Time4VPS).
    • Example configuration for PHPMailer using SMTP with SSL/TLS:

      $mail = new PHPMailer;
      $mail->isSMTP();
      $mail->Host = 'smtp.example.com';
      $mail->Port = 465; // Check your SMTP provider's documentation for the correct port
      $mail->SMTPSecure = 'ssl'; // Use 'tls' if your SMTP provider requires it
      $mail->SMTPAuth = true;
      $mail->Username = '[email protected]';
      $mail->Password = 'your-password';
      $mail->setFrom('[email protected]', 'Your Name');
      $mail->addAddress('[email protected]', 'Recipient Name');
      $mail->Subject = 'Testing PHPMailer';
      $mail->Body = 'This is a test email.';
      
      if (!$mail->send()) {
        echo 'Mailer Error: ' . $mail->ErrorInfo;
      } else {
        echo 'Message sent!';
      }
      

    4. Verify SMTP Connectivity

    • Ensure that your server can connect to the SMTP server over the specified port (usually 465 for SSL or 587 for TLS).
    • Check if there are any firewall rules or network restrictions preventing outbound connections on these ports.

    5. Debugging

    • Enable PHPMailer debugging to get more detailed error messages:
      php $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Set to 2 for detailed debugging

    6. Consult VestaCP Documentation and Support

    • Review the VestaCP documentation or reach out to their support for specific guidance on configuring email settings with nginx and PHP-FPM.

    By following these steps, you should be able to diagnose and resolve the issue with sending emails from your web application on your VestaCP server. If the issue persists, consider consulting with a system administrator or your hosting provider latest version for further assistance.

Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2024 Time4VPS. All rights reserved.

Get In Touch