<%@ Import Namespace="System.Net" %> 
<%@ Import Namespace="System.Net.Mail" %>
 
<script language="C#" runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
       //create the mail message
        MailMessage mail = new MailMessage();
 
        //set the addresses
        mail.From = new MailAddress("yourname@yourdomain.com");
        mail.To.Add("recipient_email@domain.com");
        
        //set the content
        mail.Subject = "This is a test email from C# script";
        mail.Body = "This is a test email from C# script";
        //send the message
         SmtpClient smtp = new SmtpClient("smtp.yourdomain.com");
          
         NetworkCredential Credentials = new NetworkCredential("smtp@yourdomain.com", "password");
         smtp.Credentials = Credentials;
         smtp.Send(mail);
         lblMessage.Text = "Mail Sent";
    }
</script>
<html>
<body>
    <form runat="server">
        <asp:Label id="lblMessage" runat="server"></asp:Label>
    </form>
</body>


Note:-  You will require to make some changes in your script like SMTP server, email address & password etc. 


You can use GMail or 3rd Party SMTP service for more troubleshot. 


To avoid any issue in your business email delivery. Its always recommended using Transaction SMTP service for contact form or any notification feature like


https://www.smtp2go.com/?s=w3services