VB.Net ile mail göndermek
Public Sub mailgonder(ByVal dosya As String, ByVal kullanici As String, ByVal sifre As String, ByVal kime As String)
Dim iMsg, iConf, Flds
iMsg = CreateObject(“CDO.Message”)
iConf = CreateObject(“CDO.Configuration”)
Flds = iConf.Fields
Dim schema As String
schema = “http://schemas.microsoft.com/cdo/configuration/”
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”) = kullanici ‘ gene gmail olması lazım.
Flds.Item(schema & “sendpassword”) = sifre
Flds.Item(schema & “smtpusessl”) = 1
Flds.Update()
With iMsg
.To = kime
.From = “Bayram DEDE”
.Subject = “Log Kaydı”
.HTMLbOdy = “Log Kaydı” & timestamp()
.Organization = “Bayram DEDE”
.ReplyTo = “-”
.AddAttachment(kaydet) ‘resmin bulunduğu adres
.Configuration = iConf
.send()
End With
End Sub