fl****@ptd.net wrote:
Hi,
First I would like to say thanks in advance for any help offered.
i am creating a customer database, when needed i have to have the
ability to click on a client and maybe hit a send email button/link
that will send that client a generic email.
I know this is possible, I just can't figure out how, my hosting does
not support cdonts so i have to use cdo
Again, thanks
Lizz
Hmmm ... I hope this isn't for spam!
Option Explicit
Public Sub VerySimpleSendMailWithCDOSample()
' requires reference to cdosys.dll
Dim iCfg As CDO.Configuration
Dim iMsg As CDO.Message
Set iCfg = New CDO.Configuration
Set iMsg = New CDO.Message
With iCfg.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPServer) = "smtp.mail.yahoo.ca"
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "lylefair"
.Item(cdoSendPassword) = "ThePassWord"
.Item(cdoSendEmailAddress) = "Lyle Fairfield
<ly******@yahoo.ca>"
.Update
End With
With iMsg
.Configuration = iCfg
.Subject = "Test"
.To = "ly***********@aim.com"
.TextBody = "Test"
.Send
End With
End Sub