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 ?
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
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 25 guests