title: Using mailgun on laravel 5.2 - failed to authenticate my sandbox account
body: <p>I'm using Laravel 5.2 that has mailgun integrated. Was trying to send out email via SMTP but couldn't succeed because of the error:</p>
  
  <blockquote>
    <p>Failed to authenticate on SMTP server with username
    "postmaster@sandboxe56d93c917b144e98a4f07d1dbf2683a.mailgun.org" using
    3 possible authenticators</p>
  </blockquote>
  
  <p>I'm developing the app on my localhost with virtual host set up (i.e. <code>app.dev.local</code>) so I have to use the sandbox account to do all the testing.</p>
  
  <p>These are the laravel's <code>config/mail.php</code>:</p>
  
  <pre><code>'driver' =&gt; env('MAIL_DRIVER', 'mailgun'),
  'host' =&gt; env('MAIL_HOST', 'smtp.mailgun.org'),
  'port' =&gt; env('MAIL_PORT', 587),
  'from' =&gt; ['address' =&gt; null, 'name' =&gt; null],
  'encryption' =&gt; env('MAIL_ENCRYPTION', 'tls'),
  'username' =&gt; 'postmaster@sandboxe56d93c917b144e98a4f07d1dbf2xxxx.mailgun.org',
  'password' =&gt; 'mypassword'
  </code></pre>
  
  <p><code>service.php</code>'s configurations</p>
  
  <pre><code>'mailgun' =&gt; [
      'domain' =&gt; 'sandboxe56d93c917b144e98a4f07d1dbf2xxxx.mailgun.org',
      'secret' =&gt; 'key-63sztbx99h-qdhp7j3-gp6346jsxxxx',
  ],
  </code></pre>
  
  <p>Everything looks good as I copied directly from my mailgun dashboard for the sandbox account, but the app still can't send out email due to failed authentication.</p>
  
  <p>Does anybody know what is happening here?</p>