Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gmail via cdo2000

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
I am sending email/gmail via following methods

1>

I got error : 1429
Mesaje : OLE IDispatch exception code 0 from CDO.Message.1: The transport failed to connect to the server.

2> another try with


I got error : 1429 # send # 132 # 0x00000213 The transport failed to connect to the server.

Anybody help me.
 
Hi,

Since you did not give the actual codes you are using, we can only guess.
Would it be that you have not replaced the personal settings with your personal settings so it still reads 'yourGmailAccount@gmail.com'
instead of your actual address?

Links from Sergey given by you and by Olaf are identical.

Regards,

Jockey(2)




 
OK, first of all sorry for posting something you already tried.

I tried the shorter wiki example and after getting error 80040217 I found out it's because I activated 2 steps authentication in my google account and then you need to define separate passwords for apps at

You can use this to generate a password usable in your VFP code for the smtp server connection, you can't use your normal google account password.

Bye, Olaf.
 
Thanks this is what I have not tried.

provided link appear screen "App passwords"
"The setting you are looking for is not available for your account."
"Show all account settings"

I opened link "Show all account settings"

in "Sign-in & security"

2-Step Verification Off

 
If you don't have configured 2 steps verification it's recommendable you do so.
I don't see the options you get for the link provided, as I do use 2 steps verification, so I can't tell what you'd need to setup there.
The mere problem you're facing is an authentication problem and we can't fix that for you, the code works as provided.

Bye, Olaf.
 
Yes, I configured 2 step verification and tried with 16-character password but problem is remain same. Any more suggestion please ?
 
What did you try with the 16 char password, Sergeys code or the wiki code?

The wiki code works for me with the app password, obviously the code "CDO with VFP and Gmail / Google Apps". The password has to be used without the spaces.

Bye, Olaf.
 
What did you try with the 16 char password, Sergeys code or the wiki code?

Both

Using app password without spaces with wiki code.

Sergey's code using from last 1 year without any problem. It's not working from 3-4 weeks. When Sergey's code was not working I tried wiki code. but both code is not working for me.
 
So try to find the failing omponent, try if CDO itself is still working by using another mail server.

Bye, Olaf.
 
I tried my level best. I think, I need help to find the failing components of cdo.
I am using xp,vfp9
Only I could try for \windows\system32\cdosys.dll revise registry.
 
I'm saying you should try another mail server, of course with another mail address. I don't think you have a dll problem, you just have an authentication problem, but if another mail adress and server doesn't work you might have a CDO setup problem. Just notice CDO is not a system component, it comes in several differing version with exchange or outlook or other software, but if you just need to send mail there are dozens of different options, so if another mail server with easier authentication than google not needing SSL turns out to work your CDO installation is fine, the problem then might be SSL, can be a multitude of problems including root certificates, but first of all, please test another mail server than google and you're one step further in finding out the failing component.

Bye, Olaf.
 
Hi,
newtofoxpro said:
Sergey's code using from last 1 year without any problem. It's not working from 3-4 weeks
What was changed on your system / pc? since the last time you had no problems with CDO using the procedure as per Sergey?
Regards,
Jockey(2)
 
Hi,
newtofoxpro said:
I am using xp,vfp9
Suppose you are using vfp9.2 ? What is the version number ( ? version() ) your vfp system returns?
Regards,
Jockey(2)
 
I'm saying you should try another mail server, of course with another mail address.
Yes I tried aol
problem same.

What was changed on your system / pc? since the last time you had no problems with CDO using the procedure as per Sergey?

Nothing.

Suppose you are using vfp9.2 ? What is the version number ( ? version() ) your vfp system returns?

Visual FoxPro 09.00.0000.7423 for Windows

Apart from above trial

I re-install Office 2007
problem remain same.

 
Did you try aol with the same code/settings? I suggest you use something you can connect to without SSL, but with normal port 25:

.ITEM(lcSchema + "smtpserverport") = 25
.ITEM(lcSchema + "smtpusessl") = .F.

Bye, Olaf.

 
aol working with following settings.

.ITEM(lcSchema + "smtpserverport") = 587
.ITEM(lcSchema + "smtpusessl") = .F.

google account already working from several years. so I wish to continue it. what must be wrong with gmail ?
 
>Google account already working from several years.
Well, something must have changed.

It would now be time to post your configuration (minus confidential password info), Gmail worked for me, as said, but needed an app password, as said, but maybe you didn't configure some other settings correctly.
If whatever worked for years was also using CDO you didn't made that very clear yet, it seems you tried something new.

At least we now know the CDO classes still work. So something about SSL might have changed or something about your gmail account.

Bye, Olaf.

 
To be more concrete I tested this code of the wiki about gmail and it works for me with my google account in 2 steps verification via app password:

Creating an app password
step 1: custom name
gmailstep1_yqbulr.jpg

step 2:
gmailstep2_xrvydt.jpg

step 3:
gmailstep3_xebbjs.jpg


Take that password (without spaces) to this code. Copy& PAste, don't write it down, please. It'll be copied without the spaces, correctly:

Code:
TRY
  LOCAL lcSchema, loConfig, loMsg, loError, lcErr
  lcErr = ""
  lcSchema = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/"[/URL]
  loConfig = CREATEOBJECT("CDO.Configuration")
  WITH loConfig.FIELDS
    .ITEM(lcSchema + "smtpserver") = "smtp.gmail.com"
    .ITEM(lcSchema + "smtpserverport") = 465
    .ITEM(lcSchema + "sendusing") = 2
    .ITEM(lcSchema + "smtpauthenticate") = .T.
    .ITEM(lcSchema + "smtpusessl") = .T.
    .ITEM(lcSchema + "sendusername") = "you@gmail.com" && [highlight #FCE94F]of course your gmail address[/highlight]
    .ITEM(lcSchema + "sendpassword") = "[highlight #FCE94F]theapppasswordyougotfromgoogle[/highlight]"
    .UPDATE
  ENDWITH
  loMsg = CREATEOBJECT ("CDO.Message")
  WITH loMsg
    .Configuration = loConfig
    .FROM = "you@gmail.com"
    .TO = "another.mail@ofyou.com"
    .Subject = "Test of GMail"
    .TextBody = "Testing GMail smtp SSL connection via app password"
    .Send()
  ENDWITH
CATCH TO loError
  lcErr = [Error: ] + STR(loError.ERRORNO) + CHR(13) + ;
    [Line: ] + STR(loError.LINENO) + CHR(13) + ;
    [Message: ] + loError.MESSAGE
FINALLY
  RELEASE loConfig, loMsg
  STORE .NULL. TO loConfig, loMsg
  IF EMPTY(lcErr)
    MESSAGEBOX("The mail was sent", 64, "OK")
  ELSE
    MESSAGEBOX(lcErr, 16 , "Error")
  ENDIF
ENDTRY
This worked for me on three computers, now.

You can make such a password invalid again, if you revoke it:

gmailstep4_hy5zpl.jpg


If that doesn't solve it, I'm out of ideas of what's wrong with your computer.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top