I have the following code inside my asp.net console application to send an email using office 365 smtp server:-
static private void sendemail(ClientContext contex