17 Ocak 2012 Salı

Gmail Hesabıyla Mail Gönderme

Posted by Unknown On 13:13 1 comment

Önce gmail hesabınız yoksa bir tane gmail hesabı açın.
--------------------------------------------------------------------------

Dim iMsg, iConf, Flds

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

' send one copy with Google SMTP server (with autentication)
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") = "gmail hesabınızı yazın"
Flds.Item(schema & "sendpassword") = "şifrenizi yazın"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update

With iMsg
.To = "gÖNDERİLECEK mAİL Adresi"
.From = "Myname <myemail@mydomain.com>"
.AddAttachment "BURAYA DOSYA YOLUNU YAZARAK DOSYA GÖNDEREBİLİRSİNİZ."
.Subject = "Test send with gmail account"
.HTMLBody = message
.Sender = "Myname"
.Organization = "Myname"
.ReplyTo = "myemail@mydomain.com"
Set .Configuration = iConf
SendEmailGmail = .Send
End With

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

-------------------------------------------------------------------------------------


1 yorum:

Yorum Gönder