I am working PHP contact form. Mail sent when i am working localhost. Using server success message displayed, but mail not receive.....
//Load phpmailer
$mail = new PHPMailer(true);
try {
//Server settings
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->Username = 'abc@gmail.com';
$mail->Password = 'Abc@123';
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->setFrom($data['email']);
//Recipients
$mail->addAddress('hello@gmail.com');
$mail->addReplyTo($data['email']);
//Content
$mail->isHTML(true);
$mail->Subject = 'Hi, you get message';
$mail->Body = $content;
$res= $mail->send();
//echo $res;
}