1752805 Members
5446 Online
108789 Solutions
New Discussion юеВ

mailx mime types

 
Thomas Broccoletti
Occasional Advisor

mailx mime types

Hi

Sending outbound email using mailx with attachments work on some email clients but not others. It seems like mailx does not set the content-type correctly and thus causing the attachment to appear in the body of the email as garbage. I installed PHNE_34304 that fixed some problems with mailx, however, it doesn't help the outbound mail attachments.
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: mailx mime types

Does anyone other than you and the psychics
know exactly what you're doing with mailx, or
exactly what is getting sent out as e-mail
when you do it?

The last time I used "mailx" (long ago), if
it knew what MIME was, I was blissfully
unaware of it. While I don't do this stuff,
so I know nothing, if I were to try, I would
start by using a program like "mpack" to
create a MIME-compliant message file (which
I could examine at my leisure), and then
using a program like "mailx" (in its
stupidest mode -- "-m"?) to send the result.

Knowing nothing, I can't be confident, but
I'd imagine that feeding MIME into a program
which might add its own "Mime Version,
Content Type & Content Encoding to the header
information while sending mails" could cause
it to spew some mess which might confuse the
recipient. ("man mailx".)

A Forum search here for keywords like, say,
e-mail attachment
should find many old threads on this subject.
Many folks seem to recommend using
"uuencode", but, as I said, I'd try "mpack"
(or something similar) to form a
MIME-compliant message file.
Sanjay_6
Honored Contributor

Re: mailx mime types

Hi,

Try adding these two lines into your /usr/share/lib/mailx.rc file.

set charset=us-ascii
set mimeheader=no

and then send the email attachment. I hope you are using "uuencode" or something similar.

Hope this helps.

Regds
Sanjay
Dennis Handly
Acclaimed Contributor

Re: mailx mime types

>It seems like mailx does not set the content-type correctly

mailx(1) knows nothing about attachments and basically sets the mime type to something simple like:
Content-Type: text/plain; charset=us-ascii
Rita C Workman
Honored Contributor

Re: mailx mime types

Hi Thomas,

mailx is actually an "interactive message processing system" per the manpages.

As such it doesn't have the power or flexibility to do all the MIME things.

You can use a software utility like mpack or you can use the HPUX MIME tools like sendmail or elm. Personally I use elm all the time and for attaching documents, although there are wonderfully a plethora of different utilities other prefer, my favorite is using a seperate file that uses the [include statements]. I like the include statement because I can send attachments be they plain text or MS Excel docs or images (jpeg,tiffs, etc) and I can also change things from being a base64 to quoted-printable,etc.
There have a number of MIME threads covering various ways to do this, so may I suggest you simply do a Search for MIME mail attachments and enjoy.

Kindest regards,
Rita
Dennis Handly
Acclaimed Contributor

Re: mailx mime types

>Rita: an "interactive message processing system" per the manpages.

That's a slight overstatement. It forgot to mention that it was from circa 25 years ago. :-)
I'll admit I still use it and use thunderbird if I have to deal with attachments.