How to prevent mail from going to spam using php?

Some time ago i was facing a issue regarding to the mail. Whenever i was submit my mail it goes to spam folder. Here i found a solution for that.

<?php
$to='example@gmail.com'; //enter you mail here
$subject='Application Form ';
$msg='testing';

 $headers  = 'MIME-Version: 1.0' . "\r\n";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 $headers .= 'From: admin <admin@gmail.com>' . "\r\n";
 if(mail($to,$subject,$msg,$headers))
 {
  echo "Mail Successfully Sent..";
  exit;
 }
 ?>

That’s it.

If you still have an issue please comment below.

Share With Friends

Speak Your Mind

*

Time limit is exhausted. Please reload CAPTCHA.