I'm trying to fix a issue. where email with attachments going to Spam Folder. Previously i came across similar issues & those are HTML email.but here its with attachment. if i did not add the "From" in the header email is coming to inbox (username@vps.mydomain.com). Actually i'm tying to change this sender email so that it wont go to SPAM. i have managed to change the "From" in header but still it goes to SPAM.
Also i tried "-f" concept, still it goes to SPAM.
Here is the headers & Message with attachment
$header .= "MIME-Version: 1.0\r\n";
//$header .= 'From: Move <info@ccc.com>' . "\r\n";
//$header .= "Reply-To: ".$replyto."\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$message = "This is a multi-part message in MIME format.\r\n\r\n";
$message .= "--".$uid."\r\n";
$message .= "Content-type:text/html; charset=iso-8859-1\r\n";
$message .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$message .= $emailtext."\r\n\r\n";
$message .= "--".$uid."\r\n";
$message .= "Content-Type: application/pdf; name=\"".$filename."\"\r\n";
$message .= "Content-Transfer-Encoding: base64\r\n";
$message .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";
$message .= $content."\r\n\r\n";
$message .= "--".$uid."--";
if (mail($email, $subject, $message, $header, "-finfo@ccc.com")) {