Hi rani,
You need to set EnableSsl property of SmtpClient class object to true.
Gmail uses secure channel for sending emails and you need to enable SSL security while sending emails through your application.
Then you need to Turn On the Less Secure Apps setting in your account.
For more details refer below article.