title: 504 Gateway Time-Out When PHP Sends Mail
body: <p>I am getting 504 Gateway time-outs only when an email is being generated. I've checked php.ini and set max_execution_time to 300 as well as default_socket_timeout. Once I remove the SMTP function and the site can no longer send an email there are no 504's on actions that require an email to be sent. SMTP is configured properly as I've used the same configuration on the test site. There's clearly something in the production environment missing or misconfigured but I'm not sure where to look. If anyone has any insight I would be very grateful as I've spend the last few days searching for answers.</p>
  
  <p>This is running on AWS and using Amazon SES to send emails. Both the Prod and Dev are their own instances. </p>
  
  <p>SMTP settings: (like I said, this works on the test site)</p>
  
  <pre><code>add_action( 'phpmailer_init', 'send_smtp_email' );
  function send_smtp_email( $phpmailer ) {
      $phpmailer-&gt;isSMTP();
      $phpmailer-&gt;Host       = 'host';
      $phpmailer-&gt;SMTPAuth   = true;
      $phpmailer-&gt;Port       = 25;
      $phpmailer-&gt;Username   = 'username';
      $phpmailer-&gt;Password   = 'password';
      $phpmailer-&gt;SMTPSecure = 'tls';
      $phpmailer-&gt;From       = 'info@website.com';
      $phpmailer-&gt;FromName   = 'Site Name';
      $phpmailer-&gt;SMTPDebug  = 1;
  }
  </code></pre>