I am using an email I created on the hpanel to send emails through PHPMailer. The code is hosted on hostinger's hpanel and it didn't show any errors but it also didn't give any feedback if the mail is sent or not.
require '../../vendor/autoload.php';
$mail = new PHPMailer(true);
try
{
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->Host = 'smtp.titan.email';
$mail->SMTPAuth = true;
$mail->Username = 'admin@hostinger.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'SSL';
$mail->Port = 465;
$mail->setFrom('admin@hostinger.com', 'Hostinger');
$mail->addAddress($email, $username);
$mail->addReplyTo('admin@hostinger.com', 'For any Information');
$mail->addCC('admin@hostinger.com');
$mail->isHTML(true);
$mail->Subject = 'Sending message';
$mail->Body = $message;
$mail->AltBody = "Hello there";
$mail->send();
echo "Sent";
}
catch (Exception $eax)
{
echo 'EMAIL SENDING FAILED. INFO: '.$mail->ErrorInfo;
}
Can someone help me in solving this?