First of all, make sure that the credentials are correct to connect to the gmail server.
Another thing is you have not assigned values to "
MailSubject" or "
Body", but called the function
"smtp.Send()"
.
Please have a look at the useful answers at
Sending email in .NET through Gmail[
^], where I am able to find some differences.
Try to implement those answers.
Please let me know, if you still face problems, I will work out for you then.
Thanks...