Merhaba,
Server-Client uygulamasında SERVER a ait Ip aderesinin değişme ihtimaline karşı IP adresini bir Gmail hesabı ile başka bir mail aderesine gönderen program kodlarını aşağıda bulabilirsiniz...Kodlar VB 6.0 içindir.
Bu örnekteki kodlar bir buton ile mail gönderme işlemini içeriyor. Fakat bir timer veya Label 1 deki Ip adresin değişim kontrolunu izleme üzerine yapılacak değişiklik ile IP adresi değişimlerinde yada belirlenen zaman aralığında otmatik mail gönderme işlemi gerçekleşitirilebilir.
Private Sub CommandButton1_Click()
Dim iMsg, iConf, Flds
On Error GoTo Son
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "
Error"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = TextBox1.Text
Flds.Item(schema & "sendpassword") = TextBox2.Text
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = TextBox3.Text
.From = TextBox1.Text
.Subject = "SERVER IP Adresi"
.HTMLbOdy = Label1.Caption
.Organization = "Mail Organtion"
.ReplyTo = "-"
Set .Configuration = iConf
SendEmailGmail = .Send
Son:
End With
End Sub
Private Sub Form_Load()
Label1.Caption = Winsock1.LocalIP
End Sub