FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CDO.Message method Send()
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
CDO.Message method Send()
Posted: Mon Dec 05, 2016 10:25 AM

Hi, all !

For several years, from time to time, used the program sending messages using CDO. Now needed to make the list, but get the error:
Error CDO.Message/3 DISP_E_MEMBERNOTFOUND: SEND
What could be the reason ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CDO.Message method Send()
Posted: Mon Dec 05, 2016 10:49 AM

Please review this thread:

viewtopic.php?p=173383#p173383

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: CDO.Message method Send()
Posted: Tue Dec 06, 2016 06:45 AM

Antonio, thanks for your answer !
I made a double authentication for Google account and received the password of the application. How should I use this password from your program ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CDO.Message method Send()
Posted: Tue Dec 06, 2016 09:23 AM

Could you provide a small self contained example PRG of what you are testing ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: CDO.Message method Send()
Posted: Tue Dec 06, 2016 10:25 AM
Code (fw): Select all Collapse
procedure GMAdr(m_nam, pss, s_nam, adr, sbj, fil)
local st, zz, cBcc:=""
local oEmlCfg := CREATEOBJECT( "CDO.Configuration" )
** m_nam - Inbox
** pss   - password
** s_nam - sending
** adr   - address list
** sbj   - {Titul, Msg Text}

  WITH OBJECT oEmlCfg:Fields
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value := "smtp.gmail.com"
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value := 465
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value := 2   // Remote SMTP = 2, local = 1
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value := .T.
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value := .T.
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value := m_nam // Gmail A/c ID
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value := pss  // Password
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value := 30

     :Item( "http://schemas.microsoft.com/cdo/configuration/languagecode"):Value:= 1049
     :Item( "http://schemas.microsoft.com/cdo/configuration/usemessageresponsetext"):Value:= .T.

     :Update()
   END WITH

   oEmlMsg := CREATEOBJECT ( "CDO.Message" )
   for st=1 to len(adr) // address list
 
     WITH OBJECT oEmlMsg
       :Configuration = oEmlCfg
*      :BodyPart:CharSet = "windows_1251" // language

       :From = chr(34)+" "+s_nam+" "+chr(34)+"<"+m_nam+">" // This will be displayed as From address
       :To = adr[st]      // To Email ID
       :BCC = cBcc        // BCC Id бЄалв п Є®ЇЁп
       :Subject = sbj[1]  // Titul
       :TextBody = sbj[2] // Msg Text
       for zz=1 to len(fil)
         :AddAttachment(fil[zz])  // attached files
       next
       :Fields:update()
     END WITH
     oEmlMsg:Send()
     sysrefresh()
     inkey(0.1)
   next
   inkey(0.1)
Return
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: CDO.Message method Send()
Posted: Tue Dec 06, 2016 03:13 PM

Natter

The gmail account has to be configured to sign-in with 'less secure apps' .. see link

Rick Lipkin

https://myaccount.google.com/intro/security

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: CDO.Message method Send()
Posted: Tue Dec 06, 2016 04:14 PM

Thanks, Rick ! All work fine !!!

Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: CDO.Message method Send()
Posted: Tue May 30, 2017 02:49 PM
hi
I'm trying this code:
Code (fw): Select all Collapse
  oEmailCfg := CREATEOBJECT( "CDO.Configuration" )
  WITH OBJECT oEmailCfg:Fields
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value             := "smtp.gmail.com"
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value         := 465
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value              := 2  
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value       := .t.
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value             := .T.
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value           := "myemail@gmail.com"
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value           := "mypsw"
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value := 30
     :Update()
  END WITH


    oEmailMsg := CREATEOBJECT ( "CDO.Message" )
    WITH OBJECT oEmailMsg
        :Configuration      := oEmailCfg
        :From               := "myemail@gmail.com"
        :To                 := "myfriendemail@tiscali.it"
        :Subject            := "Soggetto"
        :TextBody            := "Testo"
        :BCC := ""
        :Fields:Update()
        :Send()
    END WITH


but I get always:
Error description: Error CDO.Message/3 DISP_E_MEMBERNOTFOUND: SEND

any help?
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: CDO.Message method Send()
Posted: Wed May 31, 2017 06:27 AM

ok solved!

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: CDO.Message method Send()
Posted: Sat Jun 03, 2017 07:07 AM

Damiano

Please tell us how you solved it.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: CDO.Message method Send()
Posted: Tue Jun 06, 2017 03:08 PM
hi James
I followed Rick Lipkin suggestion.
in this link: https://myaccount.google.com/intro/security
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)

Continue the discussion