title: PHPMailer Not Sending to Outlook.com
body: <p><strong>Background:</strong></p>
  
  <p>I have been using <a href="https://github.com/PHPMailer/PHPMailer" rel="nofollow noreferrer">PHPMailer</a> to send emails through my website, but lately, certain people have not been able to receive my emails.</p>
  
  <p>I tested the issue, and it seems like emails cannot be sent to emails on Outlook.com.</p>
  
  <p>On the other hand, the emails can be sent to all other email services that I have tested including Gmail and Zoho.</p>
  
  <p>I have tried using <code>$mail-&gt;SMTPAuth = true</code> (<a href="https://stackoverflow.com/a/1698946/4283581">link</a>) and the <code>$mail-&gt;SMTPOptions</code> (<a href="https://stackoverflow.com/a/30803024/4283581">link</a>) workarounds that I have found as suggestions from elsewhere.</p>
  
  <p><code>$mail-&gt;send()</code> seems to return <code>true</code>, and I do not receive any errors from <code>$mail-&gt;ErrorInfo</code>.</p>
  
  <p>Regardless, the emails that I send will not send to Outlook.com email addresses.</p>
  
  <p><strong>Is there some sort of security feature that I need to add to allow sending to Outlook email addresses?</strong></p>
  
  <p>Please let me know if there is any other information that I can provide. Any help would be appreciated!</p>
  
  <p><strong>PHPMailer Code:</strong></p>
  
  <pre><code>require 'Classes/mail/PHPMailerAutoload.php';
  
  $mail = new PHPMailer;
  
  $recipient = $_POST['email_address'];
  $recipient = preg_replace( '/\s+/', '', $recipient );
  $recipient = trim( $recipient, ';' );
  
  $recipient_array = explode( ';', $recipient );
  
  $subject = $_POST['email_subject'];
  $body = nl2br( $_POST['email_message'] );
  
  $footer =   '&lt;br /&gt;
              &lt;table id="email_footer"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          EMAIL SIGNATURE
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;hr /&gt;
                          FOOTER IMAGE
                          &lt;hr /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td style="font-size:15px"&gt;
                          ADDRESS
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;';
  
  $attachment = 'pdf/' . $_POST['attachment'];
  
  $mail-&gt;isSMTP();                                // Set mailer to use SMTP
  $mail-&gt;Host = 'localhost';                      // Specify main and backup SMTP servers
  $mail-&gt;SMTPAuth = true;                         // Enable SMTP authentication
  $mail-&gt;Username = 'webmaster@example.com';      // SMTP username
  $mail-&gt;Password = 'password123';                // SMTP password
  $mail-&gt;SMTPSecure = 'tls';                      // Enable TLS encryption, `ssl` also accepted
  $mail-&gt;Port = "25";                             // TCP port to connect to
  
  $mail-&gt;SMTPOptions = array (
      'ssl' =&gt; array (
          'verify_peer'       =&gt; false,
          'verify_peer_name'  =&gt; false,
          'allow_self_signed' =&gt; true
      )
  );
  
  $mail-&gt;setFrom( 'webmaster@example.com', 'Business Name' );
  $mail-&gt;addReplyTo( 'webmaster@example.com', 'Business Name' );
  
  for ( $i = 0; $i &lt; count( $recipient_array ); $i++ )
  {
      $mail-&gt;addAddress( $recipient_array[$i] );
  }
  
  $mail-&gt;addAddress( 'example@zoho.com' );                            // Forwards to local email for records (cannot send email to own server [workaround])
  
  $mail-&gt;Subject = $subject;                                          // Subject
  $mail-&gt;Body = $body . '&lt;br /&gt;' . $footer;                           // Body of email
  $mail-&gt;AddAttachment( $attachment, 'purchase-order.pdf' );          // Attach a file
  
  $mail-&gt;isHTML( true );                                              // Set email format to HTML
  
  if( !$mail-&gt;send() )
  {
      echo 'Message could not be sent.&lt;br /&gt;';
      echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  }
  </code></pre>
  
  <p><strong>Thank you for your time.</strong></p>