0

I am facing an issue in php email. I am sending multiple attachments in email and it is working fine with gmail but i am not able to receive email in outlook or in rediffmail

My email code:

$header = "From: Futureshirts <designImages@futureshirts.com>\r\n";
    $header .= "Reply-To: noreply@futureshirts.com\n";
    $header .= "MIME-Version: 1.0\n";
    $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\n\n";
    $emessage= "--".$uid."\n";
    // attachments
    foreach ($imgArr as $key => $file) {
        $content = file_get_contents($file);
        $content = chunk_split(base64_encode($content));
        $fileToExp = $file;
        $value = explode("/", $fileToExp);
        $fileName = strtolower(array_pop($value));   //Line 32
        $emessage.= "Content-type:text/plain; charset=iso-8859-1\n";
        $emessage.= "Content-Transfer-Encoding: 7bit\n\n";
        $emessage .= $message."\n\n";
        $emessage.= "--".$uid."\n";
        $emessage .= "Content-Type: application/octet-stream; name=\"".$fileName."\"\n";
        $emessage .= "Content-Transfer-Encoding: base64\n";
        $emessage .= "Content-Disposition: attachment; filename=\"".$fileName."\"\n\n";
        $emessage .= $content."\n\n";
        $emessage .= "--".$uid."--";
        //unlink($file);
    }
    //SEND Mail
     mail($mailto, $subject, $emessage, $header);
Mahesh Singh Chouhan
  • 2,558
  • 1
  • 16
  • 26

0 Answers0