Email When IP Changed - Hotmail Only (VB2010 for Win 7 Machine)
Load the program, put your email and password into the boxes and it will email you (from your own mailbox) when you have a new IP address. Only works with Hotmail accounts.
The code is below if anyone wants to make sure I am not scamming you lol
www.sting3g.com/patches/IPChecker.rar
Any issues, give me a shout (please ignore the sloppy code, I just wanted to make one quickly lol).
Load the program, put your email and password into the boxes and it will email you (from your own mailbox) when you have a new IP address. Only works with Hotmail accounts.
The code is below if anyone wants to make sure I am not scamming you lol
www.sting3g.com/patches/IPChecker.rar
Any issues, give me a shout (please ignore the sloppy code, I just wanted to make one quickly lol).
Code:
Imports System.Text.RegularExpressions
Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mime
Public Class Form1
Private Function GetExternalIp() As String
Try
Dim ExternalIP As String
ExternalIP = (New WebClient()).DownloadString("http://checkip.dyndns.org/")
ExternalIP = (New Regex("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")) _
.Matches(ExternalIP)(0).ToString()
Return Convert.ToString(ExternalIP)
Catch
Return Nothing
End Try
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim MyIP As String = GetExternalIp()
TextBox2.Text = MyIP
If MyIP <> Nothing Then
If MyIP <> TextBox1.Text Then
EmailMe()
TextBox1.Text = MyIP
End If
End If
End Sub
Private Sub EmailMe()
Dim Email1 As New MailMessage
Dim smtpserver As New SmtpClient("smtp.live.com", 587)
If TextBox4.Text = "" Then Exit Sub
Try
Email1.From = New MailAddress(TextBox3.Text)
Email1.To.Add(TextBox3.Text)
Email1.Subject = "New IP Address"
Email1.Body = TextBox2.Text
Email1.Priority = MailPriority.High
smtpserver.UseDefaultCredentials = False
smtpserver.Credentials = New Net.NetworkCredential(TextBox3.Text, TextBox4.Text)
smtpserver.Port = 587
smtpserver.Host = "smtp.live.com"
smtpserver.EnableSsl = True
smtpserver.Send(Email1)
Catch
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyIP As String
If Timer1.Enabled = True Then
Timer1.Enabled = False
Button1.Text = "Start"
Else
MyIP = GetExternalIp()
TextBox1.Text = MyIP
Timer1.Enabled = True
Button1.Text = "Stop"
End If
End Sub
End Class
Last edited: