J
John
Hi there,
I'm sure this is very basic for those who know..............but can anyone
tell what I'm doing wrong?
I'm trying out a 'send email from page' from a Wrox book and getting the
following error:
"No connection could be made because the target machine actively refused it
"
Basically I've got a textbox and a button and have place the following code
uder the click event:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim message As New System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)")
message.Subject = "An Email Message From the web"
message.Body = Me.TextBox1.Text
Dim smtp As New System.Net.Mail.SmtpClient("localhost")
smtp.Send(message)
End Sub
I'm developing this in VS 2005 Pro (nb not IIS).
Please help a beginner!
Best regards
John
I'm sure this is very basic for those who know..............but can anyone
tell what I'm doing wrong?
I'm trying out a 'send email from page' from a Wrox book and getting the
following error:
"No connection could be made because the target machine actively refused it
"
Basically I've got a textbox and a button and have place the following code
uder the click event:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim message As New System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)")
message.Subject = "An Email Message From the web"
message.Body = Me.TextBox1.Text
Dim smtp As New System.Net.Mail.SmtpClient("localhost")
smtp.Send(message)
End Sub
I'm developing this in VS 2005 Pro (nb not IIS).
Please help a beginner!
Best regards
John