Youtrack allow to send email through 3rd party SMTP server. Fields are as follows:
I was using 2-Step Verification on my Gmail Account and this caused an error sending an email. To resolve first I created an App Password (see: https://support.google.com/accounts/answer/185833)
NOTE: to be able to create an App Password it's absolutely necessary to enable 2-Step Verification in your google account. If you don't do it, you'll receive a message indicating that your account doesn't support App Passwords.
Then using these settings I was able to send a test email: