what is the code for sending IP via textbox1.text and button1.text
Printable View
what is the code for sending IP via textbox1.text and button1.text
sending where?
to my mail...
vb Code:
Dim mMsg As New System.Net.Mail.MailMessage() With mMsg .To.Add("[email protected]") .Sender = New System.Net.Mail.MailAddress("[email protected]") .Subject = "Subject" .Body = "message body" End With Dim SmtpPort = 25 ' Usually it's 25 Dim SMTP As New Net.Mail.SmtpClient("smtpserver.domain1.com", SmtpPort) SMTP.Credentials = New Net.NetworkCredential ("smtp username", "smtp password") ' If the server requires authorization SMTP.Send(mMsg)
how about with ip on subject
...
i have a problem ..
i have no winsock on my com components on choose item.... why
Can you give a more detailed description of your problem?
What you do? What is your code? What exactly is a problem. Which IP you want to send? Are there any error messages, if yes, then kindly provide them. If you think that your messages in this thread make any sense then you're mistaken.
ip of sender will see on the mail with their IP...
how to put this code so i need to import?
Quote:
i put this to button1.text and label1.text
but not ok it said error when i run
Quote:
Private Sub GetIPAddress()
Dim strHostName As String
Dim strIPAddress As String
strHostName = System.Net.Dns.GetHostName()
strIPAddress = System.Net.Dns.Resolve(strHostName).AddressList(0).ToString()
MessageBox.Show("Host Name: " & strHostName & "; IP Address: " & strIPAddress)
End Sub
This is the part where you tell us which line of code is telling you there is an error and what that error is, we are not mind readers.
Have you added a reference to System.Net like the links say?