Hi,
Apologies as I'm a bit of a beginner with this. I'm trying to send an email from my ASP.NET website using the following code (obviously replacing the hostname, username and password with the actual values):
Public Shared Sub Send(ByVal ToEmail As String, ByVal FromEmail As String, ByVal Subject As String, ByVal Message As String)
Dim mm As New MailMessage(FromEmail, ToEmail, Subject, Message)
Dim smtp As New SmtpClient("hostname")
smtp.Credentials = New NetworkCredential("username", "password")
smtp.Send(mm)
End Sub
When trying to send out the mail I'm receiving this error:
"Unable to read data from the transport connection: net_io_connectionclosed."
I've had a look on various forums to try to find some help with this but I'm not really sure what I should be doing to recify this.
Any help would be very much appreciated. Thanks.