title: Swiftmailer mails go into SPAM Folder
body: <pre><code>$headers = "\r\n" . "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
  
  $message = Swift_Message::newInstance()
                  -&gt;setSubject($subject)
                  -&gt;setFrom(array('from@mail.com' =&gt; 'From Address'))
                  -&gt;setTo(array('to@mail.com' =&gt; 'To Address'))
                  -&gt;setBody($message_plain_txt)
                  -&gt;addPart($message, 'text/html')
          ;
  if ($file_name)
          {
              $message-&gt;attach(Swift_Attachment::fromPath($file_path));
          }
  
  $result = $mailer-&gt;send($message);
  </code></pre>
  
  <p>In this case $filepath is the tmp path which I am using when a user attaches a files from a form and $file_name is the tmp file name $_FILES['file']['name'].</p>
  
  <p>In this setup I am able to send mails but when there is an attachment, the mail goes into SPAM folder. If there is no attachment then mail goes into inbox.</p>
  
  <p>This setup works perfectly fine when I am uploading a file from a location and not sending the attachment from a form.</p>
  
  <p>I think it has got something to do with the email headers, but i am not able to figure out the error.</p>
  
  <p>Can some one please help me with what mistake I am doing here.</p>
  
  <p>Got it working by modifying headers to </p>
  
  <pre><code>$headers = "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
  </code></pre>