title: phpmailer gmail emails go to spam
body: <p>I know this question has been asked before but my issue is a bit different. I use the php mailer to send a bulk of mails in a loop to customers from the database. In the body of the mail when there's no html stuff like body = "hello" the emails get delivered to the normal inbox. However, when I use html tags in $mail->Body then the email goes to spam. The code I use:</p>
  
  <pre><code>        $mail = new PHPMailer;  
          $mail-&gt;isSMTP();                                      // Set mailer to use SMTP 
          $mail-&gt;Host = 'someone';  // Specify main and backup SMTP servers   
          $mail-&gt;SMTPAuth = true;                               // Enable SMTP authentication 
          $mail-&gt;Username = 'someemail.com';                 // SMTP username 
          $mail-&gt;Password = 'password';                           // SMTP password    
          $mail-&gt;SMTPSecure = 'tls';                           
  
          $mail-&gt;From = 'someemail.com';  
          $mail-&gt;FromName = 'Mailer'; 
          #$mail-&gt;addAddress($email);               // Name is optional   
          $mail-&gt;addAddress('someemail.com');
          $mail-&gt;AddEmbeddedImage('rr.jpg', 'logoimg', 'rr.jpg');
          $mail-&gt;AddEmbeddedImage('bottom.gif', 'bottomimg', 'bottom.gif');
          $mail-&gt;WordWrap = 100;                                 // Set word wrap to 50 characters    
          $mail-&gt;isHTML(true);                                  // Set email format to HTML   
          $username = "123";
  
          $mail-&gt;Subject = 'Welcome'; 
          $mail-&gt;Body = "Hello, welcome"
          $mail-&gt;AltBody = 'Welcome ';
          $mail-&gt;send()
  </code></pre>
  
  <p>The issue is only with gmail. All other major mail providers such as yahoo, hotmail and live are fine. The emails go to inbox. It may be because I use quite a lot of html, colors etc in the email. But I don't know why gmail moves the mail to spam simply because it looks like many other spam mails. Is there any solution?   </p>