0

i have used mail() , when i tried with "test" as subject mails are going fine to the inbox but when i change the subject line to 6 or 7 words mails are going to spam . Please can any one help me out . because my subject will be keep on changing so i need a permanent solution even after i change the subject line .

i have tried to put the sender in $header and i checked with mime type still it does not work

require_once("mailer.php");

    if(isset($_POST['to']) && !empty($_POST['to']) && isset($_POST['subject']) && !empty($_POST['subject']) && isset($_POST['from']) 
    && !empty($_POST['from'])){
    $receieverEmailIdArray = explode(',',$_POST['to']);
    $from= $_POST['from'];

    $subject= $_POST['subject'];
    }

    else {
        echo "Fill all the fields.";
        die();
    }

    $smtptype= 'godaddy';

    $content= "<html>
</html>"

Thanks, Raghu

Shankar Damodaran
  • 65,155
  • 42
  • 87
  • 120

1 Answers1

0

You can add the Detailed headers Code below.

$headers = "From: Example@site.com\r\n";
$headers .= "Reply-To: Example@site.com\r\n";
$headers .= "Return-Path: Example@site.com\r\n";
$headers .= "CC: Example@site.com\r\n";

if ( mail($to,$subject,$message,$headers) ) 
  {
 echo "The email has been Successfully sent!";
  } 
 else
  {
  echo "Email Sending Failed";
   }
  ?> 

Refer this Site this has some useful Information Click Here!!!

coolprarun
  • 1,005
  • 2
  • 15
  • 22