Operating System - HP-UX
1827804 Members
2344 Online
109969 Solutions
New Discussion

Re: mailx with attachment

 
skt_skt
Honored Contributor

mailx with attachment

HP-UX 11.23

#what /usr/sbin/sendmail
/usr/sbin/sendmail:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030415 $
Copyright (c) 1998 HEWLETT PACKARD COMPANY and its licensors,
including Sendmail, Inc., and the Regents of the
University of California. All rights reserved.
version.c 8.11.1 (Berkeley) - 15 June 2007 (PHNE_35951)

any one familier with sending attachments on mailx??
6 REPLIES 6
Pete Randall
Outstanding Contributor
James R. Ferguson
Acclaimed Contributor

Re: mailx with attachment

Hi:

A _very_ useful cheat-sheet is the attachment by Dave La Mar in his post here:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1046448

Regards!

...JRF...
skt_skt
Honored Contributor

Re: mailx with attachment


here is right way to attach.

#uuencode attachtest attachtest.txt |sendmail name@domain.com
Johnson Punniyalingam
Honored Contributor

Re: mailx with attachment

uuCommand to attached file in sendmail:

#uuencode filename filaname.txt|sendmail abc.efg@hp.com
OLDsyslog.log

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Aneesh Mohan
Honored Contributor

Re: mailx with attachment

Hi Santhosh,

Send EMAIL attacments by mail.

*******************************************************************************
E-mail attachments:

Assume that "test.txt" has the contents for the body of the mail, "test1"
has the contents for the first attachment and "test2" has the contents
for the second attachment)

CODE:

ux2dos text1 > text1.txt
ux2dos text2 > text2.txt

uuencode test1.txt test1.txt >> test.txt
uuencode test2.txt test2.txt >> test.txt
mailx -m -s "Test Subject" tpardike@????.??? < test.txt

This sends a mail with the subject and a body and 2 attachments.

"Test Subject" is sent as the SUBJECT of the mail.
test.txt is sent as the BODY of the mail.
test1.txt is sent as ATTACHMENT 1 in the mail.
test2.txt is sent as ATTACHMENT 2 in the mail.
********************************************************************************


Thanks,
Aneesh
Jeeshan
Honored Contributor

Re: mailx with attachment

sample script

#!/usr/bin/sh
mailx -m -s "Stuff..." whoever@somewhere.com << END
$(ux2dos /etc/hosts | uuencode /etc/hosts)
a warrior never quits