Operating System - OpenVMS
1753477 Members
5875 Online
108794 Solutions
New Discussion юеВ

Attaching a file and sending it using mail

 
GNJ
Advisor

Attaching a file and sending it using mail

Hi
I am writing a script(DCL script) to get some data in a file and I want to add a command to send this file as an attachment, in this script.
Normal Mail command helps me to send this data as the mail body . but how can I send it as an attachment?
Please suggest the options for doing this

Regards
Jayakrishnan G Naik
11 REPLIES 11
Karl Rohwedder
Honored Contributor

Re: Attaching a file and sending it using mail

I found the attached routine somewhere and added a german help. It creates a mail messgae incl. attachment and uses either VMS Mail oder SFF to send it.
You may use it as a starter...

regards Kalle
Oswald Knoppers_1
Valued Contributor

Re: Attaching a file and sending it using mail

Maybe another job for the mailsym symbiont. You can find it on the freeware cd or at:

http://oswald.knoppers.googlepages.com/mailsymhome
Steve-Thompson
Regular Advisor

Re: Attaching a file and sending it using mail

It's very simple.

$Mail

Improve on the above adding a subject.
$mail /subject="some comment" .

Remember that you cant send the log of a batch job this way as the log is still open.
Karl Rohwedder
Honored Contributor

Re: Attaching a file and sending it using mail

Sorry,

it's not that simple, if you want to put multiple attachments into you mail.
You can create the mail with plain DCL, but the format is quite sensitive.

regards Kalle
labadie_1
Honored Contributor

Re: Attaching a file and sending it using mail

here is a solution

Example-C,C++ SMTP Mail Message Sender With MIME File Attachments

http://h18000.www1.hp.com/support/asktima/communications/009F15E8-A8CE0B38-
1C02A1.html
Joseph Huber_1
Honored Contributor

Re: Attaching a file and sending it using mail


Maybe also the public domain MPACK program is of interest here:
< http://nchrem.tnw.tudelft.nl/openvms/software2.html >
http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: Attaching a file and sending it using mail

And in my site help:
< http://wwwvms.mppmu.mpg.de/vmsdoc/help/ >
follow the MAIL -> MIME link.
http://www.mpp.mpg.de/~huber
Hoff
Honored Contributor

Re: Attaching a file and sending it using mail

The OpenVMS Frequently Asked Questions (FAQ) has the answer for this and many other, well, frequently-asked questions.

FAQ home:

http://64.223.189.234/vmsfaq

You can download the whole document as a text or PDF and easily skim or search the document.

In this case...

6.2 How do I send or read attachments in VMS MAIL?

Is there any way to send or read mail with files as
attachments from VMS?

Not directly with the OpenVMS MAIL facility, but there
are several other options:

o Install PINE, available commercially from Innosoft
or free from Andy Harper. With PINE you can both
send and receive MIME messages, if you have the
appropriate viewers available.

o http://www.process.com/

o http://www.agh.cc.kcl.ac.uk/files/vms/pine-vms/

o ftp://ftp2.kcl.ac.uk/pub/vms/pine-vms/

o If you are working from an X Windows display, you
can use the OpenVMS version of Netscape Navigator or
Mozilla. The mail download protocol chosen to access
the mail server from the Navigator or Mozilla mail
client can be POP or IMAP, with the former causing
messages to be downloaded while the latter permits
messages to be retained on the mail server. Most
folks prefer IMAP for this reason.

o MPACK/MUNPACK. To send a MIME mail, construct the
message with attachments manually using MPACK. You
cannot send the resulting file directly through MAIL
because an extra blank header line will be inserted
between your message and the OpenVMS MAIL headers,
which will cause the message to appear as plain text
in most mail programs. Some TCP/IP stacks provide
a work around for this problem, and if that doesn't
work, you should generally be able to force the
message directly into the SMTP port of your mail
machine. Examples of both methods are in:

o http://saf.bio.caltech.edu/pub/software/openvms/mmail.com

To read a MIME mail message, open it in MAIL,
extract it to a file, then use MUNPACK to break
out and decode the attachments.

MPACK/MUNPACK tools are also available on OpenVMS
Freeware V5.0.

o With OpenVMS V7.2 and later, use the MIME tool
supplied with OpenVMS.
Joseph Huber_1
Honored Contributor

Re: Attaching a file and sending it using mail

BTW, MPACK can easily made working with VMS TCPIP$SMTP mail transport (without the infamous empty line before the Mime headers):

Edit the file encode.c,
there are two times lines producing
"Message-Id" and "Mime-Version" headers.
Just change the order: first Mime-Version, then message-Id, and voila, the TCPIP$SMTP_mailshr will happily handle Mpack's output like MIME's output: no premature end of headers by an empty line.
http://www.mpp.mpg.de/~huber