Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #12127 > unrolled thread

Have you sent email within Access via Gmail?

Started byPatrick Finucane <patrickfinucanetx@gmail.com>
First post2016-10-04 06:36 -0700
Last post2016-10-05 07:58 -0700
Articles 4 — 2 participants

Back to article view | Back to comp.databases.ms-access


Contents

  Have you sent email within Access via Gmail? Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-10-04 06:36 -0700
    Re: Have you sent email within Access via Gmail? Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-10-04 07:17 -0700
    Re: Have you sent email within Access via Gmail? Ron Weiner <rw@domain.com> - 2016-10-04 14:35 -0400
      Re: Have you sent email within Access via Gmail? Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-10-05 07:58 -0700

#12127 — Have you sent email within Access via Gmail?

FromPatrick Finucane <patrickfinucanetx@gmail.com>
Date2016-10-04 06:36 -0700
SubjectHave you sent email within Access via Gmail?
Message-ID<3f8b1759-11dd-42be-a8c7-ceae42fe760b@googlegroups.com>
I need to send some email via Gmail, not Outlook.  I came across this link.  http://www.blueclaw-db.com/access_email_gmail.htm  

It looks pretty simple.  Here's the code.

The line I am confused about is 
  Set cdomsg = CreateObject("CDO.message")

Do you know what version of CDO I use?  I am using Access 2013.

Public Function send_email()

Set cdomsg = CreateObject("CDO.message")
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mygmail@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
.Update
End With
' build email parts
With cdomsg
.To = "somebody@somedomain.com"
.From = "mygmail@gmail.com"
.Subject = "the email subject"
.TextBody = "the full message body goes here. you may want to create a variable to hold the text"
.Send
End With
    Set cdomsg = Nothing
End Function 

[toc] | [next] | [standalone]


#12128

FromPatrick Finucane <patrickfinucanetx@gmail.com>
Date2016-10-04 07:17 -0700
Message-ID<bae974f0-da9a-4d2a-92f2-93e9f30c6e51@googlegroups.com>
In reply to#12127
On Tuesday, October 4, 2016 at 9:37:14 AM UTC-4, Patrick Finucane wrote:
> I need to send some email via Gmail, not Outlook.  I came across this link.  http://www.blueclaw-db.com/access_email_gmail.htm  
> 
> It looks pretty simple.  Here's the code.
> 
> The line I am confused about is 
>   Set cdomsg = CreateObject("CDO.message")
> 
> Do you know what version of CDO I use?  I am using Access 2013.
> 
> Public Function send_email()
> 
> Set cdomsg = CreateObject("CDO.message")
> With cdomsg.Configuration.Fields
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
> .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mygmail@gmail.com"
> .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
> .Update
> End With
> ' build email parts
> With cdomsg
> .To = "somebody@somedomain.com"
> .From = "mygmail@gmail.com"
> .Subject = "the email subject"
> .TextBody = "the full message body goes here. you may want to create a variable to hold the text"
> .Send
> End With
>     Set cdomsg = Nothing
> End Function

I got it to work.  I had to download the CDO 1.2.1.  Then update the username and password, the to and from fields, and then allow gmail to use a less secure sending option and voila, my email was sent.  I rarely use Outlook so this was a godsend.

[toc] | [prev] | [next] | [standalone]


#12129

FromRon Weiner <rw@domain.com>
Date2016-10-04 14:35 -0400
Message-ID<nt0sq6$eo7$1@dont-email.me>
In reply to#12127
Patrick Finucane formulated on Tuesday :
> I need to send some email via Gmail, not Outlook.  I came across this link.  
> http://www.blueclaw-db.com/access_email_gmail.htm  
>
> It looks pretty simple.  Here's the code.
>
> The line I am confused about is 
>   Set cdomsg = CreateObject("CDO.message")
>
> Do you know what version of CDO I use?  I am using Access 2013.
>
> Public Function send_email()
>
> Set cdomsg = CreateObject("CDO.message")
> With cdomsg.Configuration.Fields
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM 
> method .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 
> "smtp.gmail.com" 
> .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587 
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True 
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") 
> = 60 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = 
> "mygmail@gmail.com" 
> .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = 
> "mypassword" .Update End With ' build email parts
> With cdomsg
> .To = "somebody@somedomain.com"
> .From = "mygmail@gmail.com"
> .Subject = "the email subject"
> .TextBody = "the full message body goes here. you may want to create a 
> variable to hold the text" .Send
> End With
>     Set cdomsg = Nothing
> End Function 

Been using CDO for years ro send many hundreds of thousands of emails 
at work.  It has worked extremely well for me for years.  Here is a 
link to the origional code I wrote/stole more than a decade ago.
http://0173b9e.netsolhost.com/worksRite/CDOMail.htm

Since then I have discovered (wrote/stole) how to embed pictures(mostly 
Barcodes) directly into the message and use CSS to create attractive 
emails.

Rdub

[toc] | [prev] | [next] | [standalone]


#12131

FromPatrick Finucane <patrickfinucanetx@gmail.com>
Date2016-10-05 07:58 -0700
Message-ID<89862387-4d3e-464f-a71f-6f64de209b1d@googlegroups.com>
In reply to#12129
On Tuesday, October 4, 2016 at 2:36:08 PM UTC-4, Ron Weiner wrote:
> Patrick Finucane formulated on Tuesday :
> > I need to send some email via Gmail, not Outlook.  I came across this link.  
> > http://www.blueclaw-db.com/access_email_gmail.htm  
> >
> > It looks pretty simple.  Here's the code.
> >
> > The line I am confused about is 
> >   Set cdomsg = CreateObject("CDO.message")
> >
> > Do you know what version of CDO I use?  I am using Access 2013.
> >
> > Public Function send_email()
> >
> > Set cdomsg = CreateObject("CDO.message")
> > With cdomsg.Configuration.Fields
> > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM 
> > method .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 
> > "smtp.gmail.com" 
> > .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587 
> > .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 
> > .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True 
> > .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") 
> > = 60 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = 
> > "mygmail@gmail.com" 
> > .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = 
> > "mypassword" .Update End With ' build email parts
> > With cdomsg
> > .To = "somebody@somedomain.com"
> > .From = "mygmail@gmail.com"
> > .Subject = "the email subject"
> > .TextBody = "the full message body goes here. you may want to create a 
> > variable to hold the text" .Send
> > End With
> >     Set cdomsg = Nothing
> > End Function 
> 
> Been using CDO for years ro send many hundreds of thousands of emails 
> at work.  It has worked extremely well for me for years.  Here is a 
> link to the origional code I wrote/stole more than a decade ago.
> http://0173b9e.netsolhost.com/worksRite/CDOMail.htm
> 
> Since then I have discovered (wrote/stole) how to embed pictures(mostly 
> Barcodes) directly into the message and use CSS to create attractive 
> emails.
> 
> Rdub

Thanks for you code.  I now see how to attach files.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.ms-access


csiph-web