Re: DEFINE MAIL How many attach files?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Feb 16, 2017 4:06 pm
by MarcoBoschi
Very strange: only 10!
Please...
Re: DEFINE MAIL How many attach files?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Feb 16, 2017 5:21 pm
by Enrico Maria Giordano
Each attachment has to be an array of two items:
AADD( aFile, { "fullpath and filename", "filename only" } )
EMG
Re: DEFINE MAIL How many attach files?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Feb 17, 2017 11:24 am
by MarcoBoschi
This little test program asks number of files
Create files
Create Array
and then
define mail .....
The limit is 10!
Unfortunately the limit is 10
Any ideas?
Marco
- Code: Select all Expand view
#include "fivewin.ch"#include "mail.ch" FUNCTION SPEDISCITO
( ) LOCAL i
LOCAL oMail
LOCAL aTo :=
{} LOCAL aFiles :=
{} LOCAL aFile :=
{} LOCAL iFile :=
0 LOCAL cFile
LOCAL nFiles :=
0 MsgGet
( "How Many files" ,
"files ", @nFiles
) FERASE
( "list_of_attach.txt" ) FOR iFile :=
1 TO nFiles
cFile :=
"file_attach" + ALLTRIM
(STR
(iFile
)) +
".txt" AADD
( aFile ,
{ curdrive
() +
":\" + CurDir() + "\
" + cFile , cFile } )
NEXT
FOR iFile := 1 TO nFiles
creafile( aFile[ iFile , 1 ] , "TEXT OF ATTACH FILE
" )
NEXT iFile
FOR iFile := 1 TO nFiles
IF FILE( aFile[ iFile , 1 ] )
AADD( aFiles , { aFile[ iFile , 1 ] , aFile[ iFile , 2 ] } )
ENDIF
NEXT iFile
FOR iFile := 1 TO nFiles
logfile( "list_of_attach.txt
" , { aFiles[ iFile , 1 ] , aFiles[ iFile , 2 ] , FILE( aFiles[ iFile , 1 ] ) } )
NEXT iFile
AADD( aTo , { "info@marcoboschi.it" , 1 } )
DEFINE MAIL oMail ;
SUBJECT "TEST
" ;
TEXT "TEST
" ;
FROM USER
FOR i := 1 TO LEN( aTo )
AADD( oMail:aRecipients, aTo[ i ] )
NEXT i
IF LEN( aFiles ) <> 0
oMail:aFiles := aFiles
ENDIF
? LEN( oMail:aFiles)
ACTIVATE MAIL oMail
RETURN NIL
FUNCTION Creafile( cFile, cStringa )
LOCAL nHandle := FCreate( cFile )
LOCAL cLeggiTest
LOCAL lRitorna
IF FError() <> 0
RETURN .F.
ENDIF
FWrite( nHandle, cStringa, Len(cStringa) )
FClose( nHandle )
cLeggiTest := MEMOREAD( cFile )
lRitorna := ( FError() == 0 ) .AND. ( cStringa = cLeggiTest )
RETURN lRitorna
Re: DEFINE MAIL How many attach files?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Tue Feb 21, 2017 12:01 pm
by MarcoBoschi
only ten files seem so few...isn't it?
![Shocked :shock:](./images/smilies/icon_eek.gif)