1847041 Members
3883 Online
110261 Solutions
New Discussion

Re: Sendmail / Mailx

 
Junior C.
Frequent Advisor

Sendmail / Mailx

How do I send attachment using sendmail or mailx

Thanks,
Junior
8 REPLIES 8
Rick Garland
Honored Contributor

Re: Sendmail / Mailx

Check into mutt - it will allow attachments.
Brian M. Fisher
Honored Contributor

Re: Sendmail / Mailx

You can use the following command to send an attachment:
uuencode your_file_name | sendmail -v user@mail
or use mpack available at Software Porting And Archive Centre for HP-UX :
http://hpux.cs.utah.edu/

Brian
<*(((>< er

Perception IS Reality
Kofi ARTHIABAH
Honored Contributor

Re: Sendmail / Mailx

Check out the following thread on the same subject:

http://atwnt370.external.hp.com/cm/QuestionAnswer/1,1150,0x8e557e990647d4118fee0090279cd0f9,00.html

you could also click on the search button on the left and search for sendmail AND attachment

Good luck
nothing wrong with me that a few lines of code cannot fix!
Anthony deRito
Respected Contributor

Re: Sendmail / Mailx

The simplest way to send a file as a mail attachment is like the following:

$ uuencode surfing.jpeg surfing.jpeg | sendmail sylvia@home.com

In the command above you have to specify the file name two times: the first name is the input file to be encoded, and the second name is the file name the recipient will see.

Tony

Ron Gordon
Advisor

Re: Sendmail / Mailx

There are three ways to send and attachment.

# (1) Send in body of e-mail
mailx -s 'Subject Lines goes here' user@company.com < filename.txt

# (2) To send as an attachment
/usr/bin/uuencode filename.Z filename.Z | /usr/sbin/sendmail user@company.com

# (3) To send as an attachment with Subject, From and To

(
echo "From: "
echo "To: "
echo "Subject: "
echo "This is the body of the e-mail.^M
If you are having any problem with this file please give us a call.^M^M^M
^M
^M
"
/usr/bin/uuencode /local/filename filename
) | /usr/sbin/sendmail user@company.com

Junior C.
Frequent Advisor

Re: Sendmail / Mailx

Thanks, All

Ron, Setp #3 work great Thanks.

Rita C Workman
Honored Contributor

Re: Sendmail / Mailx

I accomplished this on a 10.2 system. You may wish to check your patch on 11.0 to ensure that it has MIME capability. For 10.2 I had to load patch PHNE_15835.
The next thing you have to do is create a small file (ex include.file) that is used to send the file as an attachment. There are a few things you could read on this for more details at HP's IT Resource if you want. But simple create a file with this syntax:

[include text.txt text/plain base64]
where text.txt is your file.

The general format is: [include filename type/subtype encoding]
type/subtype= text/plain, image/gif, image/jgp etc..
encoding=base64, quoted-printable etc...

Now from the command line to send this file as an attachment to user_abc:

elms -s 'Test attachment file' user_abc@your_org.com
Rita C Workman
Honored Contributor

Re: Sendmail / Mailx

I forgot to mention before; make sure you have Elm ver 2.4 at least.
This method will send files as TRUE attachments - not as part of the body of the mail.
Regards,