I was trying to send an email using PHPmailer. My username and password are correct and there are no errors, But my email is not deliverd. Is there anyone that can help me out?
here's my code:
$mail = new PHPMailer();
$mail->SMTPDebug = 2;
$mail->IsSMTP();
$mail->Mailer = "smtp";
$mail->Host = "myhost";
$mail->Port = "25"; // 8025, 587 and 25 can also be used. Use Port 465 for SSL.
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = "myuser";
$mail->Password = "**********";
$mail->From = "from.example.com";
$mail->FromName = "fromname";
$mail->AddAddress($email, "Jordy OL");
$mail->Subject = $subject;
$mail->IsHTML(true);
$mail->msgHTML($message);
$mail->WordWrap = 50;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
exit;
} else {
$mail->ErrorInfo;
echo 'Message has been sent.';
}