i developed one program for sending mail in asp.net .. when i execute my program from local server ,it shows the below the error.
net.io.connectionclosed.. how i can correct this error.. This is the code for my mail application..
Imports System.Net.Mail.SmtpClient
Partial Class PhaseEmail
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub BtnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSend.Click
Dim MailObj As New System.Net.Mail.SmtpClient
MailObj.Host = "localhost"
MailObj.Send(TxtFrom.Text, TxtTo.Text, TxtSubject.Text, TxtMessage.Text)
Label1.Text = "Message sent successfully"
End Sub
End Class