Re: Sendmail attachments


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Joe Forani on June 07, 2010 at 06:59:02:

In Reply to: Re: Sendmail attachments posted by Herb Walters on June 07, 2010 at 06:40:58:

Herb,

I have a similar app for sending any kind of document as an attachment via SENDMAIL. However, I use Comet's BASE64 function to create a text file that becomes part of the SENDMAIL text file, see below.

Joe


LENGTH 30 & LOCAL DATASTRING$

9999 FORMAT DATASTRING$

FILENAME$ = 'anything.pdf' + '@00@' ! 6560
AX$ = '@3D42@' ! 10500
CX$ = '@0000@' ! 10600
DOSFC(AX$,CX$,FILENAME$) EXCP=EXCPOPEN !open document file
FILEHANDLE$ = AX$ ! 11200
PRINT 'OPEN DOCUMENT FILE: ';FILENAME$
PRINT 'COPY FILE IN PROGRESS'

ReadFile:
AX$ = "@3F00@" ! Set AX to "READ" ! 13900
IF EXT$ EQ 'HTM' THEN
DOSRW(AX$,FILEHANDLE$,80,8888) EXCP=CloseFile
BYTES = HEXDEC(AX$) ! Convert AX to decimal ! 14300
IF BYTES = 0 THEN GOTO CloseFile
TEXT$=TEXTSTRING$
WRITE (TXTFILE,HTML) ! 14620
ELSE
DOSRW(AX$,FILEHANDLE$,30,9999) EXCP=CloseFile
BYTES = HEXDEC(AX$) ! Convert AX to decimal ! 14300
IF BYTES = 0 THEN GOTO CloseFile
DATA$=BASE64(DATASTRING$,ERR) ! 14620
WRITE (TXTFILE,DATA) ! 14630
ENDIF
GOTO ReadFile

CloseFile:
AX$ = '@3E00@' ! 15400
BX$ = FILEHANDLE$ ! 15500
CX$ = '@0000@' ! 15600
DX$ = '@0000@' ! 15700
DOSMS(AX$,BX$,CX$,DX$) ! 15900
PRINT 'COPY COMPLETE.'




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]