SMTP server code problem

Working on the project Communication application in which we will send text, broadcast message and send text file and will increase the security by using SMTP server. So the project is in Java. But SMTP code in java is not able to give the correct output so please help me to solve the problem with SMTP server code.