EDN Admin
Well-known member
hey all
i have some sample code to work with CDO but none of them work
except of one and not with all sites
this is part of my code which works perfectly with gmail server but not with smtp.live.com
Set cdoMessage = CreateObject("CDO.Message")
With objFields
Set objFields = cdoMessage.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = bufMail.intSSL
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = bufMail.lngSeconds%
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = bufMail.lngPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = bufMail.strServer$
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = bufMail.strUserID$
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = bufMail.strUserPassword$
.Update
End With
With cdoMessage
.From$ = bufMail.strFromMail$
.To$ = bufMail.strToMail$ sent to myself, not at gmail
.Subject$ = bufMail.strSubject$
.TextBody$ = bufMail.strMessage$
End With
.Send
1. can someone tell me how to send a mail to live server with CDO ?
2. i also would like to know how to read mail with CDO,
i saw sample code on msdn, which uses MAPI
something like this:
myobject = CreateObject("MAPI.Session")
and some more examples, but on all of them i get error when creating the object
the only object i can create is from the example above - "CDO.Message"
can someone help me on this ?
thanks in advanced
View the full article
i have some sample code to work with CDO but none of them work
except of one and not with all sites
this is part of my code which works perfectly with gmail server but not with smtp.live.com
Set cdoMessage = CreateObject("CDO.Message")
With objFields
Set objFields = cdoMessage.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = bufMail.intSSL
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = bufMail.lngSeconds%
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = bufMail.lngPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = bufMail.strServer$
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = bufMail.strUserID$
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = bufMail.strUserPassword$
.Update
End With
With cdoMessage
.From$ = bufMail.strFromMail$
.To$ = bufMail.strToMail$ sent to myself, not at gmail
.Subject$ = bufMail.strSubject$
.TextBody$ = bufMail.strMessage$
End With
.Send
1. can someone tell me how to send a mail to live server with CDO ?
2. i also would like to know how to read mail with CDO,
i saw sample code on msdn, which uses MAPI
something like this:
myobject = CreateObject("MAPI.Session")
and some more examples, but on all of them i get error when creating the object
the only object i can create is from the example above - "CDO.Message"
can someone help me on this ?
thanks in advanced
View the full article