473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Troubleshooting NonOutlook Email Code

41 32bit
(Split from: How to make Access to send an e-mail without using outlook. )

Hi Seth...
It has been a long time since you have answered my question. I've starting my studies using the outlook as a way to transmit my e-mails from Access and just now I tryed to use Gmail as the server.
But after copying the code of the link you have suggested into my code, I got the following error:

Fail in the conection of the transport with the server.
CDO.Message 1

Could you please help me to understand what is wrong?
My code is written below:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Comando3_Click()
  2. On Error GoTo Err_Comando3_Click
  3.  
  4. Set cdomsg = CreateObject("CDO.message")
  5.     With cdomsg.Configuration.Fields
  6.          .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
  7.          .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
  8.          .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 465
  9.          .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  10.          .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
  11.          .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
  12.          .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mygmail@gmail.com"
  13.          .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
  14.          .Update
  15.     End With
  16.  
  17.    ' build email parts
  18.    With cdomsg
  19.         .To = "somebody@somedomain.com"
  20.          .From = "mygmail@gmail.com"
  21.          .Subject = "Test"
  22.          .TextBody = "Teste."
  23.          .Send
  24.     End With
  25.  
  26.     Set cdomsg = Nothing
  27.  
  28. Exit_Comando3_Click:
  29.     Exit Sub
  30.  
  31. Err_Comando3_Click:
  32.     Call ErrMsg("Private Sub Comando3_Click()")
  33.     Resume Exit_Comando3_Click
  34.  
  35. End Sub
  36.  
I got the error in the .send procedure.
Could you please help me?
Best regards
Sep 23 '16 #1
4 888
Seth Schrock
2,965 Expert 2GB
What is the error number?
Sep 23 '16 #2
Ricardo de Mila
41 32bit
Hi Seth... Thank you for replying.
The error I got was:
"It was not possible to send the message to the SMTP server. The transport error code was 0x80040217.The server answer was 'not available'"

Translated from portuguese.

Best regards
Ricardo de Milano
Sep 26 '16 #3
Seth Schrock
2,965 Expert 2GB
I need the error number as well as the description. You have given me the description, now I just need the number. Is it -2147220973 by any chance? Since it says SMTP error, try port number 587 instead of 465.
Sep 26 '16 #4
Ricardo de Mila
41 32bit
Hi Seth...
Thank you for replying.
Yes the error number -2147720973. But I have also tryed with the port number 587 and the result was the same.
I've heard that google is accepting just 465 and that's why I have tryed it.
I also have an information on my screen saying that the source of the error was on CDO.Message.1.

Thank you for helping.

Best regards
Ricardo de Milano
Sep 28 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tony Williams | last post by:
I have a tick box control that when checked opens Outlook and attaches a report. If the user clicks send then everything is OK. BUT if the user clicks the close on Outlook without sending the email...
1
by: Robert V. Hanson | last post by:
Please give me some ideas on how to setup the ability to test System.Web.Mail code to send emails using just my development computer, Win2000Pro OS and IIS5.0? Thanks, Bob Hanson
17
by: Liam.M | last post by:
Hey guys, Forgive me if my question my be alittle silly, but I would very much appreciate and assistance that could be given! My situation is as follows: I have created a Button, and set...
1
by: Liam.M | last post by:
I currently HAVE a form...a "Summary List" it could be called...which is a contineous form...AND on this form are "Four fields" from EVERY record (each on their own line) so to seak...like a...
1
by: xian2 | last post by:
Hi All, I have been using this guide http://www.compasscomputing.co.uk/code/AcceesReportsToPDFandEmail.htm to create a command button that automatically saves and e-mails your report and have...
2
by: DrNoose | last post by:
Hi! I'm working on code for a feedback form. I want the data from the user that is taken from the form to be emailed back to me. I'm using vb with visual studios 2005. I have most of the...
0
by: .spider | last post by:
Hi, I have a code here (taken from http://www.dotnetwatch.com/page294.aspx). Now i didn't think there was anything wrong with this code(no compilation errors..nothing)..and infact when i ran this...
4
n8kindt
by: n8kindt | last post by:
ok, i've done quite a bit of research on my problem here. random "! " will appear in my email that i'm sending thru cdo. i've learned that this problem occurs when there are long lines of html (or...
1
by: aquils | last post by:
I have a program which has 4 layers, the PL, Webservice, BL and DL. I have a form which sents an email, any suggestions where should I write the code for sending emails. Thanks
1
by: alibaba1 | last post by:
Hey Everyone hope all ok. I am needing your expertise. I have an html form and inside of it i have a drop down option to choose a state <select name="State"> <option value="0"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.