- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to attach the file using sendmail
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 04:53 AM
тАО01-10-2011 04:53 AM
how to attach the file using sendmail
- Tags:
- attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 05:12 AM
тАО01-10-2011 05:12 AM
Re: how to attach the file using sendmail
to use e-mail attachments. Did you look? A
Forum search for keywords like, say:
mail attachment
should find several.
http://forums.itrc.hp.com/service/james/home.do?from=forums
Also: On what?
uname -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 06:04 AM
тАО01-10-2011 06:04 AM
Re: how to attach the file using sendmail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 07:01 AM - last edited on тАО11-10-2011 01:42 PM by Kevin_Paul
тАО01-10-2011 07:01 AM - last edited on тАО11-10-2011 01:42 PM by Kevin_Paul
Re: how to attach the file using sendmail
There are third party vendor software that will do it for you.
Folks like uuencode. For myself I am a fan of the 'include' statment.
As Steven says just search for 'mail attachments sendmail' or try 'mail attachments mime'
Here is one to get you started..
http://h30499.www3.hp.com/t5/System-Administration/sending-attachment-using-sendmail/m-p/3852840#M275270
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 11:11 AM
тАО01-10-2011 11:11 AM
Re: how to attach the file using sendmail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 03:40 PM
тАО01-10-2011 03:40 PM
Re: how to attach the file using sendmail
uuencode filename filename | mailx -m -s "subject line for email" address@domain.com
and yes filename is repeated twice intentionally. fist one is the name of the file you are attaching. second is for the name of the attachment. The do not have to be the same but it helps tremendously if you keep them the same in the long run, when problems start to show up.
hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 08:19 PM
тАО01-10-2011 08:19 PM
Re: how to attach the file using sendmail
As others have pointed out, there are numerous methods - google search would probably be enlightening.
That being said, I created my own little cheat sheet for my favorite ways of doing just that:
http://www.olearycomputers.com/ll/mail_attach.html
HTH;
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 08:41 PM
тАО01-10-2011 08:41 PM
Re: how to attach the file using sendmail
Attached is a handy script which is used to attach PDF files and text files which uses sendmail.
Cheers,
Vidhya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2011 08:43 PM
тАО01-10-2011 08:43 PM
Re: how to attach the file using sendmail
#! /usr/bin/ksh
###########################################
###########################################
################
# Filename : sendMail
# Description : To send a mail to a user with an attachemnt
# Arguments : -f
# Author : P.M. Srividhya
# Date : 6-March-2007
#
#For Eg. sendMail -f -t user@host.com -c user1@host1.com -s subject -b body -a attach.txt
#############################################
###########################################
##############
export PATH=$PATH:/usr/bin:/usr/sbin:/usr/lib
if [ $# = 0 ]
then
print "Usage: $0 -f fromuser -t user@host.com -c user1@host1.com -s subject -b body -a attach.txt [optional]"
exit 1
fi
while getopts 'f:t:c:s:b:a:' opt
do
case $opt in
f)
fromAddress=$OPTARG
;;
t)
toAddress=$OPTARG
;;
c)
ccAddress=$OPTARG
;;
s)
subject=$OPTARG
;;
b)
body=$OPTARG
;;
a)
attachment=$OPTARG
;;
:)
print "$OPTARG need an argument"
exit 1
;;
\?)
print "$OPTARG need a value"
exit 1
;;
esac
done
body="$(echo $body)"
if [ -z "$fromAddress" ] || [ -z "$toAddress" ] || [ -z "$subject" ] || [ -z "$body" ]
then
print "Error: From Address, To Address, Subject and Body of the mail are required arguments"
exit 1
fi
if [ ! -z "$attachment" ]
then
if [ ! -f $attachment ] || [ ! -r $attachment ]
then
print "$attachment is not a readable file"
exit 1
else
filename=$(/usr/bin/basename $attachment)
fileextn=$(echo $filename | cut -f2 -d ".")
typeset -l fileextn=$fileextn
fi
if [ "$fileextn" = "pdf" ]
then
filetype="ACROBAT"
else
filetype="TEXT/PLAIN"
fi
boundary='=== This is the boundary between parts of the message. ==='
{
print - "From: <${fromAddress}>"
print - "To: <${toAddress}>"
print - "Cc: <${ccAddress}>"
print - 'Subject:' $subject
print - 'MIME-Version: 1.0'
print - 'Content-Type: MULTIPART/MIXED; '
print - ' BOUNDARY='\"$boundary\"
print -
print - "--${boundary}"
print -
print - $body
print -
print - "--${boundary}"
print - 'Content-Type: '$filetype'; charset=US-ASCII; name='$filename
print - 'Content-Disposition: attachment; filename='$filename
print - 'Content-Transfer-Encoding: 7bit'
print -
cat $attachment
print -
print - "--${boundary}--"
} | sendmail "${toAddress} ${ccAddress}"
else
mail -t $toAddress << EOF1
Subject: $subject
From: $fromAddress
Cc: $ccAddress
$body
EOF1
fi
exit 0