- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script send email attachment
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
Forums
Discussions
Discussions
Discussions
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
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
09-19-2005 02:48 PM
09-19-2005 02:48 PM
script send email attachment
function func_send_email
{
(
echo "Content-Type: multipart/mixed"
echo "Content-Transfer-Encoding: 8bit"
echo "From:$SEND_FROM"
echo "To:$1"
echo "Subject: $REPORT_TITLE"
cat < $2
) | /usr/sbin/sendmail -t
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 03:36 PM
09-19-2005 03:36 PM
Re: script send email attachment
Within the body of your email add this:
------------------------------------
This is my text. How are you?
[include /tmp/myattach application/octet-stream base64]
This is some more text in the middle.
[include /tmp/myexcel.xls application/ms-excel base64]
This is a closing message in the email.
----------------------------------------
That will attach /tmp/myattach and /tmp/myexcel.xls. You can include multiple attachments using this method.
Then to use it from a script:
elm -s "My Subject" user@mailserver.com < myletter
Where myletter contains the attachment include statement(s) as well as your message text. It is also necessary that you have a .elm directory
under the senders home directory because unlike the interactive version of elm the command-line version will not create a .elm directory automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 05:20 PM
09-19-2005 05:20 PM
Re: script send email attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 05:26 PM
09-19-2005 05:26 PM
Re: script send email attachment
Content-Type: application/pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 06:38 PM
09-19-2005 06:38 PM
Re: script send email attachment
I am using the email client mutt for this
http://hpux.connect.org.uk/hppd/hpux/Networking/Mail/mutt-1.5.9/
This is a script to send mail with mutt
DESTIN=your.email@company.com
SUBJECT="mail from unix server"
ATTACH1="/etc/passwd"
ATTACH2="/etc/hosts"
TEXTFILE=/etc/inittab
/usr/local/bin/mutt -a "$ATTACH1" -a "$ATTACH2" -i "$TEXFILE" -s
"$SUBJECT" $DESTIN << EOF >/dev/null 2>&1
EOF
You don't need to work with uuencode and uudecode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 07:51 PM
09-19-2005 07:51 PM
Re: script send email attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 09:12 PM
09-19-2005 09:12 PM
Re: script send email attachment
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 09:16 PM
09-19-2005 09:16 PM
Re: script send email attachment
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 09:58 PM
09-19-2005 09:58 PM
Re: script send email attachment
You can include this line to send the attachment with email..
uuencode filename.ext filename.ext | mailx -s "Attached file from unix" yoruemail@domain.com
Enjoy ,
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2005 03:38 AM
09-20-2005 03:38 AM
Re: script send email attachment
install on your box, and never look back.