Using ASP.NET To Send Email

Email is a standout amongst the most well-known and dependable strategies for correspondence for both individual and business purposes. It likewise assumes an essential part in every last Web website. This part will be in the sort of computerized messages from the server in the wake of posting data from a shape. You may have seen these sorts of messages while enrolling on a site. When you post the shape, the server will send an email requesting that you affirm either your enlistment or with the data you entered. On the off chance that you need to affirm the enrollment, the server will send you a long URL that you need to snap to continue encourage with the enlistment procedure. A great case of this usefulness is ASP.NET discussions. When you enlist, you will be messaged an irregular secret key. You will likewise get messages after your post has been acknowledged by an arbitrator or on the off chance that some individual answers to your post. On the off chance that you are pondering this is a server enchantment—it isn't. The entire procedure is influenced conceivable with the assistance of server-to side programming structure, for example, ASP and ASP.NET.

To send messages, you ought to expect access to a server with .NET Framework and SMTP empowered on it. SMTP remains for Simple Mail Transfer Protocol and messages are sent utilizing this convention. 

The .NET Framework supplies a SMTP class that empowers you to send a straightforward email message. In the event that you need to send an email with included functionalities, you need to make utilization of the MailMessage class. With the assistance of this class, you can include connections, set needs, and substantially more, effortlessly. You can likewise send HTML email utilizing this class. 

Luckily, ASP.NET makes sending email a breeze. The .NET Framework adaptation 1.x incorporated various classes in the System.Web.Mail namespace that permitted automatically sending an email with a couple of sparse lines of code. While this namespace and these classes still exist in the .NET Framework rendition 2.0, they have been deplored for new mail-related classes found in the System.Net.Mail namespace.

 

In order to send an email from an ASP.NET Web page, we need to use the SmtpMail class found in the System.Web.Mail namespace, which contains a static method Send(). OR In order to send an email from an ASP.NET Web page, we need to use the SmtpClient class found in the System.Net.Mail namespace, which contains a method Send(). SmtpMail Class Provides properties and methods for sending messages using the Collaboration Data Objects for Windows 2000 (CDOSYS) message component. Recommended alternative: System.Net.Mail. 
SmtpClient Class allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP).