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='[email protected]'; //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 <[email protected]>' . "\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

Also Read   Wordpress function to upload different type of media files

Speak Your Mind

*

Time limit is exhausted. Please reload CAPTCHA.