ARTIFACTORY: Why do I occasionally encounter the error "Failed to send email to EMAIL_ADDRESS> due to Could not connect to SMTP Host: HOST>, Port: 587" when testing my mail server settings?

AuthorFullName__c
Fadi Rouhana
articleNumber
000005787
FirstPublishedDate
2023-06-14T17:03:26Z
lastModifiedDate
2025-07-20

ARTIFACTORY: Why do I occasionally encounter the error "Failed to send email to EMAIL_ADDRESS> due to Could not connect to SMTP Host: HOST>, Port: 587" when testing my mail server settings?

When testing your mail server, you may encounter the error message "Failed to send e-mail to <EMAIL_ADDRESS> due to Could not connect to SMTP Host: <HOST>, Port: 587". If you occasionally experience this error, it usually happens when you try to test your email configuration without entering the password and relying only on the current password configuration.

The error scenario occurs when you have already successfully configured your mail server and navigate to the mail settings page. During the initial test without entering a password, the request will result in a 400 status code and the aforementioned error message. However, once you reenter the password and perform the test again, the request should be successful with a 200 status code.

To confirm this behavior, you can tail the JFROG_HOME/artifactory/var/log/artifactory-service.log file and observe the following message in the logs:

 
2023-06-07T10:12:55.472Z [jfrt ] [ERROR] [5b5495a2462dc1aa] [u.r.s.a.c.m.TestMailService:78] [http-nio-8081-exec-6] - Mail server password needs to be re-entered in order to send a test message.

This behavior is expected. When using the UI test button for the mail server configuration, the password needs to be reentered. However, it is important to note that this does not affect the overall functionality of the email feature. Once the password is entered, tested, and the mail server configuration is saved, the provided credentials are preserved and used for the mail functionality. The UI test button is designed to prompt for password reentry during the test.

Knowing why this behavior occurs will allow you to move forward with confidence, knowing that after entering the password again and saving the mail server configuration, the email feature will function as intended.