Full Version: Cdo Send Email Gmail
UtterAccess Discussion Forums > Microsoft® Access > Access Modules
Neondog82
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.

CODE
Public Function send_gmail()
'http://msdn.microsoft.com/en-us/library/aa487412(v=exchg.65).aspx
'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
Flds.Update

Dim Email As New CDO.message
Set Email.Configuration = iConf


'Compose Email
'http://msdn.microsoft.com/en-us/library/ms872547(v=exchg.65).aspx
Email.To = "First.Last@gmail.com"
Email.From = "First.Last@gmail.com"
Email.Subject = "Testing Access Email"
Email.TextBody = "Test"

'send the email
Email.Send

End Function
shadow
Read this thread:

http://www.UtterAccess.com/forum/Sending-E...o-t1957295.html

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
Neondog82
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?
shadow
QUOTE (Neondog82 @ Mar 8 2012, 10:39 PM) *
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.

Sorry...maybe someone else knows.

SHADOW
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.