Re: Multiple files thru' email

Steevan Kumar_1
New Member

Multiple files thru' email

I'm using HP-UX B.10.20 E, and I was looking to send
attachments using 'mailx' or 'elm'. Is there anyone who can
help me with this. The send command of 'mailx' doesn't list the
attachment option. Do I need to update the O.S to the next release or can I
change some configuration settings ? Also could some help me as how to send
multiple files thru' email at one time (More than one file per email)?




P.S.This thread has been moved from  HP-UX > General to HP-UX > messaging -HP Forums Moderator

Joe Holbrook_2
New Member

Re: Multiple files thru' email

From mailx all you need to do is this. You state 10.20 and I assuming you have
the mail patches.

cat file1 file2 | mailx -s test

Hope this helps
Thomas Endo
New Member

Re: Multiple files thru' email

Most modern mailers would produce a file that would be passed on to
/usr/lib/sendmail with the following headers:

From: address
To: address
Subject: subject
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="autogen-boundary"

A gap (just a carriage return followed by a line feed) is needed before the
rest of the message starts.

Then you would see a header like:

Content-Type: text/plain;charset=us-ascii;name="file1"
Content-Disposition: attachment;name="file1"

This is file1.

Then, this will be followed by a boundary:

Then if you wanted binary content, you would need a set of headers that looked
like this:

Content-Type: application/octet-stream;name="binary"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;name="binary"

The contents would differ; you may see something like application/msword.

I could send you something else that will put a file into base64 format; the
format is described in the MIME RFCs.

The last boundary in the message is required after the last byte of the
attachment. In this example it would look like


I have been doing this the hard way by hand-editing the file; though I've
written shell scripts to send things along as a remailer. I could probably
obtain the flexibility using mailx if I change the global mailrc file to allow
hand-editing of the headers.

Another newsgroup that might be useful for this would be comp.mail.sendmail.

If you have any more questions that you'd like to take offline, you can mail me

Tammy Rogers_1
Occasional Advisor

Re: Multiple files thru' email

Use the following command to send attachments from UNIX to email....

uuencode filename filename |sendmail

Where filename is the name of the attachment (Note: this needs to be specified
twice) and mailrecip is
the recipient of the email.