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

Bir cevap yazın

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>