title: Swiftmailer, Gmail, Cloud9 not working
body: <p>So, I'm about 2 weeks into trying to learn PHP and I'm working on cloud9, which doesn't support the mail() function. After a lot of looking around on here I thought I'd try Swiftmailer and Gmail. For some reason, I can't seem to get this right even after literally copying formats. I have no idea what I'm doing wrong, but I can't even get echo statements to print after the first line. I've looked at numerous previous posts. I know this is probably a really dumb problem, but I could really use some help. Any alternatives that would work better for me in cloud9 would also be appreciated if this isn't a possibility. Thank you so much for your time.</p>
  
  <pre><code>  &lt;?php
          require_once '/swiftmailer/lib/swift_required.php';
         $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
              -&gt;setUsername(USERNAME)
              -&gt;setPassword(PASSWORD);
          $mailer = Swift_Mailer::newInstance($transport);
          $message = Swift_Message::newInstance('This is a subject')
              -&gt;setFrom(array('toemail@domain.com' =&gt; 'My Name'))
              -&gt;setTo(array('fromemail@domain.com' =&gt; 'Some Name'))
              -&gt;setBody('Hello world!');
          $request = $mailer-&gt;send($message);
          echo "Hello!";
      ?&gt;
  </code></pre>
  
  <p>If I put an echo before $request, it still doesn't echo. Also, I am getting all this in my terminal:</p>
  
  <blockquote>
    <blockquote>
      <p>Started apache2 [Tue Mar 24 18:39:11.139091 2015] [mpm_prefork:notice] [pid 12191] AH00163: Apache/2.4.7 (Ubuntu)
      PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations [Tue Mar
      24 18:39:11.139160 2015] [core:notice] [pid 12191] AH00094: Command
      line: 'apache2'</p>
    </blockquote>
    
    <p>==> /home/ubuntu/lib/apache2/log/access.log &lt;==
    10.240.52.53 - - [24/Mar/2015:18:39:17 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.73.244 - - [24/Mar/2015:18:39:21 +0000] "GET /mail.php HTTP/1.1" 500 205
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:39:27 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.52.53 - - [24/Mar/2015:18:39:29 +0000] "GET /main_login.php HTTP/1.1" 200 2589
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.215.225 - - [24/Mar/2015:18:39:42 +0000] "GET /testmail.php HTTP/1.1" 200 2277
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:39:44 +0000] "POST /mail.php HTTP/1.1" 500 205 "<a href="https://seproject-hrguyll.c9.io/testmail.php" rel="nofollow">https://seproject-hrguyll.c9.io/testmail.php</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.73.244 - - [24/Mar/2015:18:39:57 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.215.225 - - [24/Mar/2015:18:40:01 +0000] "GET /testmail.php HTTP/1.1" 200 2277
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.73.244 - - [24/Mar/2015:18:40:04 +0000] "POST /mail.php HTTP/1.1" 500 205 "<a href="https://seproject-hrguyll.c9.io/testmail.php" rel="nofollow">https://seproject-hrguyll.c9.io/testmail.php</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:40:11 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:40:15 +0000] "GET /mail.php HTTP/1.1" 500 205
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.73.244 - - [24/Mar/2015:18:40:35 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:40:41 +0000] "GET /mail.php HTTP/1.1" 500 205
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.169.157 - - [24/Mar/2015:18:41:28 +0000] "GET / HTTP/1.1" 200 4997 "<a href="https://ide.c9.io/hrguyll/seproject" rel="nofollow">https://ide.c9.io/hrguyll/seproject</a>" "Mozilla/5.0 (Windows NT
    6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
    10.240.215.225 - - [24/Mar/2015:18:41:30 +0000] "GET /mail.php HTTP/1.1" 500 205
    "<a href="https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io" rel="nofollow">https://seproject-hrguyll.c9.io/?_c9_id=livepreview1&amp;_c9_host=https://ide.c9.io</a>"
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/41.0.2272.101 Safari/537.36"</p>
  </blockquote>