on 4/13/00 11:23 AM, Peter Nielsen at [log in to unmask] wrote:
> We are experimenting with a product called OpenPDF, which converts a file on
> the HP3000 into a PDF file.
>
> If I download this file using Reflection and/or FTP the file in Binary
> transfer type, I am able to open the document using Acrobat Reader.
>
> However, if I use SendMail and attach this document to it I have problems.
> When the Acrobat Reader tries to open this PDF file off of an E-mail, it
> tells me: that the file is damaged, that there was an error in opening this
> document and that it could not repair the file.
>
> Has anyone else experienced this?
> Any suggestion as to how I can attach a PDF file to an E-mail?
>
> Peter Nielsen
I hit the same problem when using the MAILFILE command file I posted a while
back. I made a couple little changes to the command file and it should work
fine now. The updated version is listed below.
-Lane
--------------
parm recipients=!HPUSER.!HPACCOUNT,&
subject='HP3000 file',&
fname,&
dest_fname="!fname"
comment This is a stripped down version of Mark Bixby's MAILSPF. MAILFILE
comment will send a specified file as an uuencoded attachment
comment Syntax:
comment
comment mailfile recipients="[log in to unmask], [log in to unmask], ...",
comment subject="subject header of e-mail message",
comment file="name of the file to send",
comment mailf_fname="name of the destination file"
comment
comment MAILFILE and
comment MAILSPF was developed under MPE/iX 5.5 PowerPatch4 and uses
Sendmail/iX
comment (http://www.cccd.edu/~markb/sendmailix.html) as a mail transport.
Note
comment that other mail transports may be used as long as the transport will
comment accept a fully formatted message that includes headers.
comment
comment Where to obtain the oringal MAILSPF CI command file:
comment
comment http://www.cccd.edu/ftp/pub/mpe/mailspf
comment or
comment ftp://ftp.cccd.edu/pub/mpe/mailspf
comment
comment How to contact the MAILSPF author:
comment
comment Mark Bixby
comment Coast Community College District
comment District Information Services
comment 1370 Adams Ave
comment Costa Mesa, CA 92626-5429
comment voice: +1 714 438-4647
comment email: [log in to unmask]
comment web: http://www.cccd.edu/~markb
comment
comment Change History
comment
comment 1.0 April 8, 1998
comment
comment Initial public release.
comment
comment Check to see if the file to send exists
comment
if FINFO( "!fname","exists") = FALSE then
echo File does not exist
return
endif
comment
comment Purge the mail message temp file if it exists.
comment
file mailfm,oldtemp
if FINFO('*mailfm','exists') then
purge mailfm,temp
endif
comment
comment Start creating the message as a temp file.
comment
build mailfm;temp;rec=,,b;disc=2147483647
comment Generate a MIME boundary string.
setvar mailf_sep RHT(RPT('-',36)+"!HPSUSAN!HPPIN!HPCPUMSECS",36)
comment Generate a temorary file name
setvar mailf_fname "/tmp/mf!HPSUSAN!HPPIN!HPCPUMSECS"
comment
comment Generate all of the message headers.
comment
echo To: !recipients>*mailfm
if HPJOBNAME = '' then
setvar mailf_from &
'"#!HPJOBTYPE!HPJOBNUM !HPUSER.!HPACCOUNT" !<!HPUSER.!HPACCOUNT!>'
else
setvar mailf_from &
'"#!HPJOBTYPE!HPJOBNUM !HPJOBNAME,!HPUSER.!HPACCOUNT"
!<!HPUSER.!HPACCOUNT!>'
endif
echo From: !mailf_from >>*mailfm
echo Subject: !subject>>*mailfm
echo MIME-Version: 1.0>>*mailfm
echo Content-Type: multipart/mixed; boundary="!mailf_sep">>*mailfm
echo >>*mailfm
comment
comment Generate the preamble (not normally displayed by MIME mail clients).
comment
echo This is a multi-part message in MIME format.>>*mailfm
comment
comment Generate the first body header
comment
echo --!mailf_sep>>*mailfm
echo Content-Type: text/plain; charset=us-ascii; name="!dest_fname"&
>>*mailfm
echo Content-Transfer-Encoding: x-uuencode>>*mailfm
echo Content-Disposition: Attachment; filename="!dest_fname" >>*mailfm
echo >>*mailfm
comment
comment uuencode the file and appened it
comment
if lft( finfo( '!fname', 13 ), 6 ) = 'BINARY'
xeq tobyte.hpbin.sys "!fname !mailf_fname"
else
xeq tobyte.hpbin.sys "-at !fname !mailf_fname"
endif
xeq uuencode.hpbin.sys "!mailf_fname !dest_fname" >>*mailfm
purge !mailf_fname
comment
comment That's all, folks.
comment
echo --!mailf_sep-->>*mailfm
comment
comment Mail the message.
comment
xeq SENDMAIL.PUB.SENDMAIL "-t" <*mailfm
comment
comment Clean up.
comment
purge mailfm,temp
reset mailfm
deletevar mailf_@
|