FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DISP_E_MEMBERNOTFOUND : CDO email
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
DISP_E_MEMBERNOTFOUND : CDO email
Posted: Fri Mar 29, 2013 07:51 PM
I put this into its own thread. This error message is being returned when trying to use CDO with an SSL email server:

DISP_E_MEMBERNOTFOUND

Here is the code. It is essentially the same as what others say works for them:

Code (fw): Select all Collapse
Function CDOSendMail( aTabMail )
    Local oEmailCfg,oEmailMsg

    TRY
       oEmailCfg := CREATEOBJECT( "CDO.Configuration" )
      WITH OBJECT  oEmailCfg:Fields
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value :=   TRIM( aTabMail[01] ) //"mail.xxxxxxxx.com"
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value :=  aTabMail[11] // 25
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value := 2   // Remote SMTP = 2, local = 1
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value :=  aTabMail[08] // .T.
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value :=  .T.
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value := TRIM( aTabMail[09] ) //  "xxanser@xxxxxxxx.com"
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value := TRIM( aTabMail[10] ) // "xxxxxx"
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value := 30
         :Update()
      END WITH
    CATCH oError
      MsgInfo( "Could not create message configuration" + ";"  + ;
             "Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + ;
             "SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + ;
             "OSCode: " + TRANSFORM(oError:OsCode, NIL) + ";" + ;
             "SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" + ;
             "Message: " + oError:Description )
       Return .F.
    END
    oError:=NIL

    TRY
     oEmailMsg := CREATEOBJECT ( "CDO.Message" )
     WITH OBJECT oEmailMsg
        :Configuration =  oEmailCfg
        :From = aTabMail[02] //chr(34)+" Anser K.K. "+chr(34)+ "<anser@xxxxxxxx.com>" // This will be displayed in the From (The email id does not appear)
        :To = TRIM( aTabMail[03] ) // "xxanserkk@xxxxx.com"    // <-----   Place the TO email address
        :Subject = aTabMail[04] // "This is a Tst message"
        //:ReplyTo =  aTabMail[02] //"xxanser@xxxxxxxxx.com" 
        //:Sender =  aTabMail[02] //"xxanser@xxxxxxxxx.com"  // Read Receipt message is send to this
        //:Organization =  TRIM( aTabMail[02] ) // "My xxxxxx Company"    // "My Company Name"
        :MDNRequested = .T.
        :HTMLBody =  "<HTML> " + TRIM( aTabMail[05] ) + " </HTML>"
        IF LEN( aTabMail[06] ) > 0
            For nEle := 1 To Len( aTabMail[06] )
             :AddAttachment( ALLTRIM(aTabMail[06][nEle] )) // := AllTrim( aAttach[ nEle ] )
            Next
        ENDIF
        :Send()
     END WITH
     SysRefresh()
    CATCH oError
        
       MsgInfo( "Could not send message" + ";"  + CRLF+ ;
         "Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + CRLF+;
         "SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + CRLF+ ;
         "OSCode: " + TRANSFORM(oError:OsCode, NIL) + ";" + CRLF +;
         "SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" +CRLF+ ;
         "Message: " + oError:Description )
       Return .F.
    
    END

Return( .t. )


Please note, UseSSL is true, and authentication is being passed as true.

For anyone using CDO who has had success with this, please review and let me know what might be causing the error.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: DISP_E_MEMBERNOTFOUND : CDO email
Posted: Sat Mar 30, 2013 09:06 AM

Tim,

In what source code line does it errors ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DISP_E_MEMBERNOTFOUND : CDO email
Posted: Sat Mar 30, 2013 10:28 AM

I bet on Send() method call. :-)

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: DISP_E_MEMBERNOTFOUND : CDO email
Posted: Sat Mar 30, 2013 06:57 PM

Tim,

Maybe this thread will help:

viewtopic.php?f=3t=15843

James

&

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: DISP_E_MEMBERNOTFOUND : CDO email
Posted: Wed Apr 03, 2013 03:41 PM

See also this thread:

viewtopic.php?f=3t=26019

&

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion