Full Version: Cdo Send Email Gmail
UtterAccess Forums > Microsoft® Access > Access Modules
Hello all. I am trying to use this module to send an email through Gmail. I keep getting an error. I have searched and came across mulitple sites. From what I gather everything should be correct. Never the less I was hoping for some help from you all.
Public Function send_gmail()
'configure email server
Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort          ' 2
Flds(cdoSMTPServer) = "smtp.gmail.com"
Flds(cdoSMTPServerPort) = 587
Flds(cdoSMTPAccountName) = "First.Last@gmail.com"
Flds(cdoSMTPAuthenticate) = 1
Flds(cdoSendUserName) = "First.Last@gmail.com"
Flds(cdoSendPassword) = "Secret1234"
Flds(cdoSendEmailAddress) = """MySelf"" <myself@example.com>"
Flds(cdoSMTPUseSSL) = True
Flds(cdoSMTPConnectionTimeout) = 60
Dim Email As New CDO.message
Set Email.Configuration = iConf
'Compose Email
Email.To = "First.Last@gmail.com"
Email.From = "First.Last@gmail.com"
Email.Subject = "Testing Access Email"
Email.TextBody = "Test"
'send the email
End Function
Read this thread:
I've been able to adapt the example there to successfully send via gmail, yahoo and my own provider. Never got Hotmail to work. See if it helps!
Shadow, thanks for the thread. Unfortunately it was one of the many I have already read through. I downloaded the attachment on the first post and it will not work for me either. I disabled both my firewall and antivirus. Any other suggestions using CDO to send Gmail? Maybe I need to use something besides CDO?
Sorry...it worked for me. I don't really know enough about the topic to specifically tell you why your code doesn't work. I pointed that thread to you hoping that the example would guide you.
orry...maybe someone else knows.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.