PHP mailer is not working for CWP ( control web panel CentOs ) email setup

2k Views Asked by At

I created new email Id for domain https://www.srirangapankajam.in/

Below are the email ID details.

Email Login URL : https://server.we3.in:2031/roundcube/

Email Id : [email protected]

Password : *******

I try to login login using above credentials but showing server error & also can't sent email using PHP library.

I also raised big in github https://github.com/PHPMailer/PHPMailer/issues/1715

I used following code to send a mail.


    $mail->SMTPDebug = 2;                                       // Enable verbose debug output
    $mail->isSMTP();                                            // Set mailer to use SMTP
    $mail->Host       = 'server.we3.in';  // Specify main and backup SMTP servers
    $mail->SMTPAuth   = true;                                   // Enable SMTP authentication
    $mail->Username   = '[email protected]';                     // SMTP username
    $mail->Password   = '*****';                               // SMTP password
    $mail->SMTPSecure = 'tls';                                  // Enable TLS encryption, `ssl` also accepted
    $mail->Port       = 587;                               // TCP port to connect to
    $mail->setFrom('[email protected]', 'Testing');
    $mail->addAddress('[email protected]'); 
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();   

Below error I get when try to sent mail using SMTP:

2019-04-29 09:29:21 SERVER -> CLIENT: 220 server.we3.in ESMTP Postfix 2019-04-29 09:29:21 CLIENT -> SERVER: EHLO localhost

2019-04-29 09:29:21 SERVER -> CLIENT: 250-server.we3.in250-PIPELINING250-SIZE 204800000250-ETRN250-STARTTLS250-AUTH PLAIN LOGIN250-AUTH=PLAIN LOGIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN

2019-04-29 09:29:21 CLIENT -> SERVER: STARTTLS 2019-04-29 09:29:21 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS SMTP Error: Could not connect to SMTP host.

2019-04-29 09:29:21 CLIENT -> SERVER: QUIT 2019-04-29 09:29:21 2019-04-29 09:29:21 SMTP Error: Could not connect to SMTP host.

Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host.

0

There are 0 best solutions below