I am EXTREMELY SORRY!. Please ignore the above code. I am posting the correct one once again.
_________________________
<%@ Page Language="
VB" %>
<% @Import Namespace="System.Web.Mail" %>
<script runat="server">
Sub btnSend_Click(sender as Object, e as EventArgs)
Dim maiLobj as New MailMessage()
maiLobj.To = "1.dipanjan@gmail.com"
maiLobj.From = "dipanjan@yahoo.co.in"
maiLobj.Subject = "Test mail"
maiLobj.Body = "Test mail. Please ignore"
maiLobj.Priority = MailPriority.Normal
maiLobj.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "127.0.0.1"
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(objMM)
msgbox("Mail Sent")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Sending mail by ASP.NET</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:button runat="server" id="btnSend" Text="Send Mail!"
OnClick="btnSend_Click" />
</div>
</form>
</body>
</html>