[Info-vax] SFF and MIME
FrankS
sapienza at noesys.com
Thu Dec 10 16:50:58 EST 2009
On Dec 10, 10:49 am, Tom <mcwilli... at aforbes.co.za> wrote:
> Can anyone perhaps point me in the right direction? Any suggestions
> would be greatly appreciated.
This is something I use to send a PDF attachment with a text message
body. You can adapt it to send an HTML attachment very easily. The
trick is that the text message body is pre-formatted with MIME
headers. Again, you can easily adapt that part as well to work with
any text file as a message body by writing the MIME headers first,
then appending the message text.
This is the command procedure:
$!
$! PDF_MAIL.COM
$!
$! E-mail a PDF document.
$!
$!
$! P1 = Source document
$! P2 = E-mail recipient
$! P3 = E-mail subject
$!
$!
$ set noon
$ vfy = F$VERIFY(0)
$
$ pid = F$GETJPI("", "PID")
$
$!
$ mime_scratch = "SYS$SCRATCH:PDF_''pid'.TXT"
$
$ define mime_build 'mime_scratch'
$ define pdf_input 'p1'
$
$!
$! Copy the "See attached" message body.
$!
$ copy sys$manager:see_attached.txt mime_build:
$
$!
$! Add the PDF document to the mime message.
$!
$ mcr mime
open /draft mime_build:
add /content="application/pdf" pdf_input:
save
$
$!
$! Send it.
$!
$ mail mime_build: "''p2'" /subject="''p3'"
$
$!
$ delete /nolog 'mime_scratch';*
$
$!
$ vfy = F$VERIFY(vfy)
$
$!
This is the pre-formatted message body (SEE_ATTACHED.TXT). The
initial blank line does not belong in the text file and is only here
for presentation clarity:
Mime-version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Message-ID: <543320237.1227538778 at OpenVMS.Mime.V1.8>
See attached report.
This is my web site (shameless plug, since I prefer to get paid for
this sort of thing):
www.noesys.com
More information about the Info-vax
mailing list