Swiftmailer transport localdomain issue

We have updated the yii swiftmailer package version to 6.0.2 in our two environments like UAT and LIVE. In UAT environment everything goes smooth and everything works as expected. But when we did same version 6.0.2 upgrade in LIVE server, we get following error when mail is being sent.

Expected response code 250 but got code “501”, with message "501 Syntactically invalid HELO

Then we find the fix for the problem by setting the localdomain explicitly in the transport object. So when we set the localdomain explicitly it works. But i need to know why this difference in two environments with same version. ?