Thanks for your reply.
Let me explain, "Not working" means what exactly happening.
Same code works fine when I send txt file as attachment but when I attach xls file as attachment, program does not give any error . Program complete successfully however no email is coming.
I further added statement session.setDebug(true) statement to debug issue. I found below findings.
1) When I add txt file as attachment, debug statements regarding attachment shows below contents.
------=_Part_0_1789447862.1582278832842
Content-Type: text/plain; charset=us-ascii; name=2.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=2.txt
2) When I add xls file as attachment, debug statements regarding attachment shows below contents.
------=_Part_0_1789447862.1582278739282
Content-Type: application/octet-stream; name=Test.xlsx
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=Test.xlsx
UEsDBBQABgAIAAAAIQCkU8XPTgEAAAgEAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyTy07DMBBF
90j8Q+Qtit2yQAg17YLHErooH2DiSWLVL3nc0v49E/exQKEVajexYs/ccz0znsw21hRriKi9q9iY
j1gBrvZKu7Zin4u38pEVmKRT0ngHFdsCstn09may2AbAgrIdVqxLKTwJgXUHViL3ARydND5ameg3
tiLIeilbEPej0YOovUvgUpl6DTadvEAjVyYVrxva3jmJYJAVz7vAnlUxGYLRtUzkVKyd+kUp9wRO
mTkGOx3wjmwwMUjoT/4G7PM+qDRRKyjmMqZ3acmG2Bjx7ePyy/slPy0y4NI3ja5B+XplqQIcQwSp
sANI1vC8ciu1O/g+wc/BKPIyvrKR/n5Z+IyPRP0Gkb+XW8gyZ4CYtgbw2mXPoqfI1K959AFpciP8
n34YzT67DCQEMWk4DudQk49EmvqLrwv9u1KgBtgiv+PpDwAAAP//AwBQSwMEFAAGAAgAAAAhALVV
MCP0AAAATAIAAAsAAABfcmVscy8ucmVsc6ySTU/DMAyG70j8h8j31d2QEEJLd0FIuyFUfoBJ3A+1
jaMkG92/JxwQVBqDA0d/vX78ytvdPI3qyCH24jSsixIUOyO2d62Gl/pxdQcqJnKWRnGs4cQRdtX1
Therefore when encoded content attachments are there like xls file, program complete successfully however no email coming.