VBScript ile GMail üzerinden mail gönderme

Epey bir araştırma yaptıktan sonra, adam akıllı çalışan bir kod buldum. Sıralama nın önemli olduğunuda öğrenmiş oldum. Çünkü diğer bulduğum kodlarda hemen hemen aynıydı, sadece sıralama farklı.

Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
Const cdoBasic = 1
Const cdoSendUsingPort = 2
Dim oMsg, oConf

' E-mail properties
Set oMsg      = CreateObject("CDO.Message")
oMsg.From     = "from@gmail.com"  ' or "Sender Name <from@gmail.com>"
oMsg.To       = "to@gmail.com"    ' or "Recipient Name <to@gmail.com>"
oMsg.Subject  = "Subject"
oMsg.TextBody = "Text body"

' GMail SMTP server configuration and authentication info
Set oConf = oMsg.Configuration
oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com"
oConf.Fields(schema & "smtpserverport")   = 465
oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
oConf.Fields(schema & "smtpauthenticate") = cdoBasic
oConf.Fields(schema & "smtpusessl")       = True
oConf.Fields(schema & "sendusername")     = "from@gmail.com"
oConf.Fields(schema & "sendpassword")     = "sender_password"
oConf.Fields.Update

oMsg.Send

Arama Kriterleri:

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>