12 Haziran 2011 Pazar

Mail Gonderme kodları

Dim iMsg, iConf, Flds

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

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") = Text1.Text
Flds.Item(schema & "sendpassword") = Text2.Text
Flds.Item(schema & "smtpusessl") = 1
Flds.Update

With iMsg
.To = Text3.Text
.From = Text4.Text
.Subject = Text5.Text
.HTMLbOdy = Text6.Text
.Organization = "Mail Organtion"
.ReplyTo = "-"
Set .Configuration = iConf
SendEmailGmail = .Send
End With