i want to send email using user's entered email address to my email address using PHPMailer and without SMTP. But it takes too much time to send email and once it sent email i got mail in spam instead of inbox. Below is my complete code-
<?php
session_start();
require_once 'class.phpmailer.php';
$mail = new PHPMailer;
$mail->From = $_POST['email'];
$mail->FromName ='Contacted By : '.$_POST['fname'];
$mail->addAddress("dev5.veomit@gmail.com");
$mail->addReplyTo($_POST['email'], "Reply");
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "<b>Name : </b>".$_POST['fname'].'<br/><b>Email Address : </b>'.$_POST['email'].'<br/><b>Message : </b>'.$_POST['msg'];
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
$_SESSION['sucess-email']='You Have Contacted Successfully.';
header("Location: https://m-expressions.com/test/voy/");
}
?>
Please help me solve this problem and thanks in advance.