From: tham chan weng on
I am trying to incorporate a simple feature for emailing and started
toying with the sample prog from VO2.6. So far I got what I want
except for the cclist. The return array does not contains the full
list. Most of the time it returns 2 and sometime the most 3 out of a
list of 5. Is this an issue with the sample, class or I miss out
something. I did not change any of codes. Just added the following for
debugging.

oPop := CFixedPop{aMailInfo[DEF_POPSERVER]}

oPop:Logon(aMailInfo[DEF_ACCOUNT],aMailInf[DEF_PASSWORD])

n := oPop:GetStatus()

nList := oPop:MailCount

FOR iMail := 1 UPTO nList
IF oPop:GetMail(iMail)
oEmailServer:Append()
oEmailServer:FIELDPUT( #E_Box, "Inbox" )
oEmailServer:FIELDPUT( #E_Date, Today())
oEmailServer:FIELDPUT( #E_To, __MakeString(oPop:Email:DestList) )
oEmailServer:FIELDPUT( #E_Subject, oPop:Email:Subject )

/// this is the part I added
? len(oPop:Email:CCList) /// returns as 2 or 3
for var := 1 upto len()oPop:Email:CCList
? oPop:Email:CCList[var]
next
wait
////

oEmailServer:FIELDPUT( #E_CCs, __MakeString(oPop:Email:CCList) )
oEmailServer:FIELDPUT( #E_Body, oPop:Email:MailBody)

cFile := SELF:GetAttachFileNames( oPop )
IF cFile != Null_String
oEmailServer:FIELDPUT( #E_Attach, cFile)
ENDIF

oEmailServer:Commit()
SELF:FillListView( SELF:oDCEmailTreeView:GetSelectedItem())

// UH 06/29/1999
// IF !oPop:DeleteMail( 1 )
IF !oPop:DeleteMail( iMail )
textbox{,"Email","Could not delete the message from the
server."}:show()
ENDIF
ENDIF
NEXT
oPop:Disconnect()
From: Stephen Quinn on
tham chan weng

Try reversing the loop counter
From
> FOR iMail := 1 UPTO nList
To
> FOR iMail := nList DOWNTO 1

As you pop each message the list decreases by 1, the loop gets the next +1
ie messages 1,3,5, etc...

CYA
Steve


From: tham chan weng on
Thanks Stephen,

No it doesn't work. However I believe you are referring to the Mail
count which is not the problem. It is the cclist array len which is
does not correspond with the list of addresses in the cc section.


On May 10, 10:04 pm, "Stephen Quinn" <stevej...(a)bigpondSPAM.net.au>
wrote:
> tham chan weng
>
> Try reversing the loop counter
>     From
>         > FOR iMail := 1 UPTO nList
>     To
>         > FOR iMail := nList DOWNTO 1
>
> As you pop each message the list decreases by 1, the loop gets the next +1
>     ie messages 1,3,5, etc...
>
> CYA
> Steve

From: Stephen Quinn on

If this is the code your talking about then you should use ALen() to get the
size of the array, Len() does a different thing in VO than it did in Clipper
(see help).

/// this is the part I added
? len(oPop:Email:CCList) /// returns as 2 or 3


// Your code is incorrect here as well - assuming it's just a typo<g>
for var := 1 upto len()oPop:Email:CCList
// for var := 1 upto Alen(oPop:Email:CCList )

? oPop:Email:CCList[var]
next
wait
////

CYA
Steve


From: tham chan weng on
Hi Stephen,

No luck. Still the same with Alen(). Yes the 2nd line is a typo. Could
this have something to do with the POP or/and SMTP server? I have
already tried 3 different POP and SMTP accounts all with the same
result.



On May 10, 11:43 pm, "Stephen Quinn" <stevej...(a)bigpondSPAM.net.au>
wrote:
> If this is the code your talking about then you should use ALen() to get the
> size of the array, Len() does a different thing in VO than it did in Clipper
> (see help).
>
> /// this is the part I added
> ? len(oPop:Email:CCList)   /// returns as 2 or 3
>
> // Your code is incorrect here as well - assuming it's just a typo<g>
> for var := 1 upto len()oPop:Email:CCList
> // for var := 1 upto Alen(oPop:Email:CCList )
>
> ? oPop:Email:CCList[var]
> next
> wait
> ////
>
> CYA
> Steve