I am searching on the web how to fix the problem with phpmailer going to the spam-box inside outlook(Hotmail).
I tried a lot of things but none of them worked.
$result = $statement->fetchAll();
if(isset($result))
{
$base_url = "http://www.gester.nl/loginsystem2/"; //change this baseurl value as per your file path
$mail_body = "
<p>Hi ".$_POST['user_name'].",</p>
<p>Thanks for Registration. Your password is ".$user_password.", This password will work only after your email verification.</p>
<p>Please Open this link to verified your email address - <a href='".$base_url."email_verification.php?activation_code=".$user_activation_code."'>".$base_url."email_verification.php?activation_code=".$user_activation_code."</a>
<p>Best Regards,<br />Gester</p>
";
require 'class/class.phpmailer.php';
$mail = new PHPMailer;
$mail->IsSMTP(); //Sets Mailer to send message using SMTP
$mail->Host = 'xxxx'; //Sets the SMTP hosts of your Email hosting, this for Godaddy
$mail->Port = '587'; //Sets the default SMTP server port
$mail->SMTPAuth = true; //Sets SMTP authentication. Utilizes the Username and Password variables
$mail->Username = 'xxxx'; //Sets SMTP username
$mail->Password = 'xxxx'; //Sets SMTP password
$mail->SMTPSecure = 'tls'; //Sets connection prefix. Options are "", "ssl" or "tls"
$mail->From = 'xxxx@mail.com'; //Sets the From email address for the message
$mail->FromName = 'Gester'; //Sets the From name of the message
$mail->Sender = $_POST['user_email'];
$mail->AddAddress($_POST['user_email'], $_POST['user_name']); //Adds a "To" address
$mail->WordWrap = 50; //Sets word wrapping on the body of the message to a given number of characters
$mail->IsHTML(true); //Sets message type to HTML
$mail->Subject = 'Email Verification'; //Sets the Subject of the message
$mail->Body = $mail_body; //An HTML or plain text message body
if($mail->Send()) //Send an Email. Return true on success or false on error
{
$message = '<label class="text-success">Register Done, Please check your mail.</label>';
}
else {
$message = '<label class="text-danger">Mail could not be send.</label>';
}
}
I hope someone could give me a good explanation on how to fix this exactly. Because there are many answers online but they are not accurate.