Unable to send email using php mailer

Unable to send email using php mailer

Hello Zoho team, 
I am trying to configure email on my website but getting the following error:

2018-10-21 05:35:39 Connection: opening to smtp.zoho.com:587, timeout=300, options=array()
2018-10-21 05:35:40 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.zoho.com:587 (Connection refused) [/home/vikashjhakash/vikashtech.com/vendor/phpmailer/phpmailer/src/SMTP.php line 325]
2018-10-21 05:35:40 SMTP ERROR: Failed to connect to server: Connection refused (111)

I have used the following code.. please suggest me a solution for the same



<?php

use PHPMailer\PHPMailer\PHPMailer;
require 'vendor/autoload.php';
    $txt = "<html>
                <head>
                <title>M/s VIKASH TECH</title>
                </head>
                <body>
                Name - ".$_POST['name']."<br/>
Email - ".$_POST['email']."<br/>
Number - ".$_POST['number']."<br/>
Message - ".$_POST['message']."<br/>

               
                </body>
                </html>
                ";
    $mail = new PHPMailer;
    $mail->isSMTP();
    $mail->SMTPDebug = 4;
    $mail->Host = 'smtp.zoho.com';
    $mail->Port = 587;
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = 'tls';
    $mail->Username = ' support@vikashtech.com';
    $mail->Password = '---mypassword---';
    $mail->setFrom(' support@vikashtech.com', 'M/s VIKASH TECH');
  
    $mail->addAddress(' support@vikashtech.com', 'M/s VIKASH TECH - Support Team');
    $mail->addAddress($_POST['email']);
    $mail->Subject = "Contact Request";
    //$mail->Body = $_SESSION['msg'].$_SESSION['otp'].$_SESSION['note'];
    $mail->msgHTML($txt, __DIR__);
   
    if (!$mail->send()) {
        echo 'Mailer Error: ' . $mail->ErrorInfo;
      
    } else {
        echo 'OK';
    }

    ?>




                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl Resources


                                                              Zoho Creator Resources


                                                                Zoho WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • Functions

                                                                      Functions

                                                                    • Meetups

                                                                      Meetups

                                                                    • Kbase

                                                                      Kbase

                                                                    • Resources

                                                                      Resources

                                                                    • Digest

                                                                      Digest

                                                                    • CRM Marketplace

                                                                      CRM Marketplace

                                                                    • MVP Corner

                                                                      MVP Corner

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now