title: phpMailer to gmail business from Heroku?
body: <p>I've been trying to set up google business email smtp. I've created an account with my own email address (username@mydomain.me). This is hosted by gmail.</p>
  
  <p>I'm using the phpMailer class on Heroku. I've already uncommented the php_openssl.dll in the php.ini file.</p>
  
  <p>I keep getting this error: </p>
  
  <pre><code>ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) SMTP Error: Could not connect to SMTP host.
  </code></pre>
  
  <p>Does anyone know what is going wrong here?</p>
  
  <pre><code> ...
   $mail-&gt;Host = "ssl://stmp.gmail.com";
   $mail-&gt;SMTPDebug  = 2;  
   $mail-&gt;SMTPAuth   = true;
   $mail-&gt;Port       = 587;
   $mail-&gt;SMTPSecure = 'ssl'; 
   $mail-&gt;Username   = "username@myDomain.me";
   $mail-&gt;Password   = "mypassword";
   $mail-&gt;SetFrom('username@myDomain.me', '...');
   $mail-&gt;AddReplyTo("an@email.co", '');
   $mail-&gt;Subject = '...';
   ...
  </code></pre>