CDO.Message method Send()

CDO.Message method Send()

Postby Natter » 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 ?
Natter
 
Posts: 1182
Joined: Mon May 14, 2007 9:49 am

Re: CDO.Message method Send()

Postby Antonio Linares » Mon Dec 05, 2016 10:49 am

Please review this thread:

viewtopic.php?p=173383#p173383
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CDO.Message method Send()

Postby Natter » Tue Dec 06, 2016 6: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 ?
Natter
 
Posts: 1182
Joined: Mon May 14, 2007 9:49 am

Re: CDO.Message method Send()

Postby Antonio Linares » Tue Dec 06, 2016 9:23 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CDO.Message method Send()

Postby Natter » Tue Dec 06, 2016 10:25 am

Code: Select all  Expand view
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
Natter
 
Posts: 1182
Joined: Mon May 14, 2007 9:49 am

Re: CDO.Message method Send()

Postby Rick Lipkin » Tue Dec 06, 2016 3: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
User avatar
Rick Lipkin
 
Posts: 2657
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: CDO.Message method Send()

Postby Natter » Tue Dec 06, 2016 4:14 pm

Thanks, Rick ! All work fine !!!
Natter
 
Posts: 1182
Joined: Mon May 14, 2007 9:49 am

Re: CDO.Message method Send()

Postby damianodec » Tue May 30, 2017 2:49 pm

hi
I'm trying this code:
Code: Select all  Expand view

  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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 418
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: CDO.Message method Send()

Postby damianodec » Wed May 31, 2017 6:27 am

ok solved!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 418
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: CDO.Message method Send()

Postby James Bott » Sat Jun 03, 2017 7:07 am

Damiano

Please tell us how you solved it.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: CDO.Message method Send()

Postby damianodec » Tue Jun 06, 2017 3:08 pm

hi James
I followed Rick Lipkin suggestion.
in this link: https://myaccount.google.com/intro/security
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 418
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests

cron