Imports System.Web.MailPublic Class WebForm2 Inherits System.Web.UI.Page Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click Dim MSg As New MailMessage Dim mAtt As MailAttachment mAtt = New MailAttachment("C:\mail.txt") MSg.From = "pcranjithindia@gmail.com " MSg.To = "pcrkidia@yahoo.co.in" MSg.Subject = " From Ranjith " MSg.Body = "Please see the attachment" MSg.Attachments.Add(mAtt) SmtpMail.Send(MSg) Response.Write(" Done") End SubEnd Class