I'm using below code for sending mail. It's working fine in gmail server, but it's not working for my domain.
It's showing an error like
Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`*.999servers.com'
How can I solve this issue?
This is my code so far:
require("PHPMailer/src/PHPMailer.php");
require("PHPMailer/src/SMTP.php");
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail = new PHPMailer\PHPMailer\PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPDebug = 4;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Host = "mail.mydomain.in";
$mail->Port = 587;
$mail->IsHTML(true);
$mail->Username = "mail";
$mail->Password = "password";
$mail->SetFrom($admin_user_mail);
$mail->AddAddress($login_user_mail);
$mail->AddCC($admin_user_mail);
$mail->Subject = "Mail Subject";
$mail->Body = "Mail Content";
if($mail->send())
{
echo "Mail Send";
} else
{
echo "Mail Not sent";
}