title: smtp relay - g suite - gmail with custom domain email
body: <p>I have a created an account from G Suite - test@my-domain.com. I have enabled 2-factor authentication and created app-specific password too.</p>
  
  <p>Also, I read that I need to allow less secure apps but I can't as I did 2-factor auth.</p>
  
  <p>Also, my domain is working on ssl certificate from LetsEncrypt.</p>
  
  <p>This is my config file:</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp-relay.gmail.com   // or smtp.gmail.com
  MAIL_PORT=465                    // or 587
  MAIL_USERNAME=test@my-domain.com
  MAIL_PASSWORD=unkdgapoymfgcwxu  &lt;&lt; app specific password
  MAIL_ENCRYPTION=ssl             // or tls
  MAIL_FROM_ADDRESS=test@my-domain.com
  MAIL_FROM_NAME=Support
  </code></pre>
  
  <p>From admin dashboard, I ticked the 'SMTP-relay' setting:</p>
  
  <pre><code>Allowed senders: Only addresses in my domains
  Only accept mail from the specified IP addresses: No
  Require SMTP Authentication: Yes
  Require TLS encryption: No
  </code></pre>
  
  <p>...and I also added 'Support' as 'Send mail as' input in Gmail Settings > Accounts</p>
  
  <p>I am stuck and keep getting error:</p>
  
  <blockquote>
    <p>Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 <a href="https://support.google.com/mail/?p=BadCredentials" rel="nofollow noreferrer">https://support.google.com/mail/?p=BadCredentials</a> i203sm350313wmf.0 - gsmtp</p>
  </blockquote>
  
  <p>I have tried all different combinations but I couldn't move any further than this error. What am I doing wrong?</p>
  
  <p>I know there are many questions related this topic but I couldn't find anything working for specifically G Suite - with custom domain</p>
  
  <hr>
  
  <p>I am not sure if G Suite is any different than Gmail, but when I tried with personal gmail account it works. So, if I try for my personal gmail with this config, it works:</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.gmail.com
  MAIL_PORT=465
  MAIL_USERNAME=me@gmail.com
  MAIL_PASSWORD=utrpokvkvwluwujx      &lt; one time password
  MAIL_ENCRYPTION=ssl
  </code></pre>