Results 1 to 10 of 10

Thread: IP Included..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2010
    Posts
    134

    IP Included..

    what is the code for sending IP via textbox1.text and button1.text

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2010
    Posts
    134

    Re: IP Included..

    to my mail...

  4. #4
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: IP Included..

    vb Code:
    1. Dim mMsg As New System.Net.Mail.MailMessage()
    2.  
    3. With mMsg
    4.     .To.Add("[email protected]")
    5.     .Sender = New System.Net.Mail.MailAddress("[email protected]")
    6.     .Subject = "Subject"
    7.     .Body = "message body"
    8. End With
    9. Dim SmtpPort = 25 ' Usually it's 25
    10. Dim SMTP As New Net.Mail.SmtpClient("smtpserver.domain1.com", SmtpPort)
    11. SMTP.Credentials = New Net.NetworkCredential ("smtp username", "smtp password") ' If the server requires authorization
    12. SMTP.Send(mMsg)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2010
    Posts
    134

    Re: IP Included..

    how about with ip on subject


    ...


    i have a problem ..

    i have no winsock on my com components on choose item.... why

  6. #6
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: IP Included..

    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.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2010
    Posts
    134

    Re: IP Included..

    ip of sender will see on the mail with their IP...

  8. #8
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: IP Included..

    Do you mean you want to get the IP address of the machine that your application is on? Did a search not bring up 1000 results?

    example1
    example2

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jul 2010
    Posts
    134

    Re: IP Included..

    how to put this code so i need to import?

    i put this to button1.text and label1.text

    but not ok it said error when i run

    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

  10. #10
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: IP Included..

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width