Introduction:
Here i am describing how to Send mail from asp.net website
Description:
This is a common function Required for every website.
For this you have to add System.Web.Mail namespace
The System.Web.Mail namespace contains classes that enable you to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server. The classes in this namespace can be used from ASP.NET or from any managed application.
For more info about System.Web.Mail click here.
Steps:-
-Create a website and design the Form like below screen
Here i am describing how to Send mail from asp.net website
Description:
This is a common function Required for every website.
For this you have to add System.Web.Mail namespace
The System.Web.Mail namespace contains classes that enable you to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server. The classes in this namespace can be used from ASP.NET or from any managed application.
For more info about System.Web.Mail click here.
Steps:-
-Create a website and design the Form like below screen
or copy this code in source code and paste within < form > tag
now go to code view and write below code
For validation just write the below javascript code in your head tag
Now you can send mail
This example is for sending mail from Gmail.
If you want any server mail just change the smtp server details with port number and use it.