Youtrack allow to send email through 3rd party SMTP server. Fields are as follows:
Minor addition to other answers.
My account have no 2-step verification, but with this solution I didn't have to log in from browser on YouTrack server machine, neither didn't have to enable less secure apps.
Config:
smtp.gmail.com
587
SMTP+TLS
user@gmail.com
******
(account password)(Nothing selected)
YouTrack
Next:
Done. Now you should be able to send test email successfully.