How to use Gmail as your SMTP server for Youtrack?

前端 未结 4 699
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 02:08

Youtrack allow to send email through 3rd party SMTP server. Fields are as follows:

  1. SMTP host: [?]
  2. SMTP port: [?]
  3. Mail protocol: [?]
  4. SMTP
相关标签:
4条回答
  • 2021-02-13 02:19

    Here is what I finally did:

    1. SMTP host: smtp.gmail.com ;
    2. SMTP port: 465 ;
    3. Mail protocol: SMTP+SSL ;
    4. SMTP login: user@domain.com or user@gmail.com ;
    5. SMTP password: ****** ;
    6. Select SSL key: No key ;
    7. Server 'from' email: user@domain.com.

    Gmail will ignore the from parameter so I put the same.

    References

    • Enable IMAP in your Gmail settings (Gmail doc) ;
    • How to use Gmail as your SMTP server.
    0 讨论(0)
  • 2021-02-13 02:32

    The other two answers are correct, but are alternatives:

    • if your google account is configured to use 2-step verification you must use an AppPaswword. In this case you cannot enable less secure apps.
    • if your google account is not configured to use 2-step verification, you must enable less secure apps, and log to your account from a browser in the machine where youtrack is installed (as pointed out in the comment). In this case you cannot create App Passwords.

    Additional notes:

    • as you can see, the youtrack configuration is the same in both cases, save for the password, which is the AppPassword if you use the first option, or the account password, if you use the second one.
    • in the from email, the email account is ignored, but you can specify a friendly name if you use this syntax: "Friendly Name <myacount@gmail.com>" When someone receives a notification he'll see From: Friendly Name. The account, whichever you specify, will be replaced by the google account you're configuring.
    0 讨论(0)
  • 2021-02-13 02:37

    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 Host: smtp.gmail.com
    • SMTP Port: 587
    • Mail Protocol: SMTP+TLS
    • SMTP Login: user@gmail.com
    • SMTP Password: ****** (account password)
    • Select SSL key: (Nothing selected)
    • From address: YouTrack <user@domain.com>

    Next:

    1. Try to send test email (the button right below youtrack config).
    2. It will fail.
    3. Now just login into google account from your regular browser.
    4. You'll get a warning about recent blocked login attempt.
    5. Open warning and verify the login attempt from IP of your youtrack server.

    Done. Now you should be able to send test email successfully.

    0 讨论(0)
  • 2021-02-13 02:39

    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:

    • SMTP host: smtp.gmail.com
    • SMTP port: 465 ;
    • Mail protocol: SMTP+SSL
    • SMTP login: user@gmail.com
    • SMTP password: #newly created app password# ;
    • Select SSL key: No key ;
    • Server 'from' email: user@domain.com.
    0 讨论(0)
提交回复
热议问题