Send Mail Using Asp.net C#



To send a mail using asp.net you need two namespaces which are
1. Using System.Net;
2. Using System.Net.Mail;
Here I have taken three textbox for getting To-email address , subject, Body or you can place them with a string in double quotes.

   If you are getting error sc.send(msg) means your Gmail account rejecting your access from other apps(asp.net).To rectify this you need to do changes in your Gmail account settings.
1.Open your Gmail account settings->sign & security-> at down you will find option called allow less secure app access: OFF now make that to ON and debug the asp.net application and after that you can check your Gmail send items.
Author :

Author

Priti Kumari

I am technical blogger.I blogs at www.c-Sharpcorner.com and https://aspdotnetmyblog.blogspot.in/.

2 comments:

  1. Valuable for information if there is any other regarding this kindly revert me back on this Asp.net Application Company

    ReplyDelete
  2. Hi,
    Thanks for sharing the info about ASP .NET Plz keep sharing on...
    Thank you...

    ReplyDelete