title: Swiftmailer - PHP-Mails landing in Spam folder
body: <p>Im using swiftmailer for sending mails via PHP. Most times it works fine. But sometimes, my mail Mails are landing in Spam-Folder.</p>
  
  <p>Here my code, which sends the mails</p>
  
  <pre><code>function sendMail2($from,$to,$subject,$body,$attachment=NULL) {
      require_once 'include_apth/swiftmailer/swift_required.php';
  
      $transport = Swift_MailTransport::newInstance();
      $mailer = Swift_Mailer::newInstance($transport);
      $message = Swift_Message::newInstance($subject);
      $message-&gt;setFrom($from);
      $message-&gt;setTo($to);
      $message-&gt;setBody($body, 'text/html');
  
      if($attachment) {
          $message-&gt;attach(Swift_Attachment::fromPath($attachment));
      }
  
      if(@$mailer-&gt;send($message)) {
          return true;
      }
      else {
          return false;
      }
  }
  </code></pre>
  
  <p>any ideas, why its landing sometimes in spam-folder?</p>