I am unable to find a reason why it doesnt execute. I am passing the service account user credentials. Can anyone please let me know if there are any other security reasons why my codes doesn't send the email?
Thank you. The error was with respect to the transport layer and i disabled SSL in the code and it worked fine. Since the mail is been sent within the network, i hope disabling SSL should'nt be a problem.