CS-5237: Fixes error while sending mail
Merge pull request #589 from m038/CS-5101

CS-5237: Fixes error while sending mail