First make sure to import the System.Web.Mail namespace to your ASP.NET script. Next, we
will be creating an object of type MailMessage, then set the required fields on that object and
then we use the SmtpMail.Send method to send the object mail to its destination. Below, we show the full ASP.NET code to send an email in HTML format: