'send mail using CDO
Dim lobj_cdomsg
Set lobj_cdomsg = CreateObject("CDO.Message")
'With lobj_cdomsg.Configuration
lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = "smtp.gmail.com"
'smtp.mail.yahoo.com
'smtp.mail.com
lobj_cdomsg.Configuration.Fields(cdoSMTPConnectionTimeout) = 60
lobj_cdomsg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort
lobj_cdomsg.Configuration.Fields(cdoSMTPServerPort) = 465
lobj_cdomsg.Configuration.Fields(cdoSMTPAuthenticate) = True
lobj_cdomsg.Configuration.Fields(cdoSMTPUseSSL) = True
lobj_cdomsg.Configuration.Fields(cdoSendUserName) = "sender@gmail.com" '
lobj_cdomsg.Configuration.Fields(cdoSendPassword) = "****thisispassword"
lobj_cdomsg.To = "sendmsgto@gmail.com"
lobj_cdomsg.From = "sender@gmail.com"
lobj_cdomsg.Subject = "mail subject "
lobj_cdomsg.TextBody = "this is the main body"
lobj_cdomsg.AddAttachment ("c:\image.jpg")
lobj_cdomsg.Configuration.Fields.Update
lobj_cdomsg.Send
No comments:
Post a Comment