Hi there
While i am sending mail from my site its showing this error. the same code was working fine earlier but now its showing the following error
Unable to read data from the transport connection: net_io_connectionclosed.
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
Source Error:
Line 30: Catch ex As Exception Line 31: Line 32: Throw ex Line 33: End Try Line 34: End Sub
|
Source File: D:\hshome\be2gether\be2gether.com\App_Code\blGlobal.vb Line: 32
Stack Trace:
[IOException: Unable to read data from the transport connection: net_io_connectionclosed.] System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) +1057579 System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) +248 System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) +16 System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +642 System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159 System.Net.Mail.SmtpClient.GetConnection() +35 System.Net.Mail.SmtpClient.Send(MailMessage message) +1213
[SmtpException: Failure sending mail.] blGlobal.SendMail(String FromAddress, String ToAddress, String subject, String TheBody, Boolean isHTML) in D:\hshome\be2gether\be2gether.com\App_Code\blGlobal.vb:32 Admin_ComposeMail.btnsendMail_Click(Object sender, EventArgs e) in D:\hshome\be2gether\be2gether.com\admin\ComposeMail.aspx.vb:113 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean include
|
and my mail sending code is
Try
Dim mail As New MailMessage()
mail.From = New MailAddress(FromAddress)
mail.To.Add(ToAddress)
mail.Subject = subject
mail.BodyEncoding = System.Text.Encoding.ASCII
mail.Body = TheBody
mail.IsBodyHtml = isHTML
mail.Priority = MailPriority.High
Dim smt As New SmtpClient("DomainIPaddress")
smt.Credentials = New NetworkCredential("webmaster@mydomain.com", "mypassword")
smt.Send(mail)
mail.Dispose()
Catch ex As Exception
Throw ex
End Try
I have googled but cant find any solution. please can anyone help me to find out the solustion its urgent.
Thanks in advance
Ram