- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: mailing a file using mailx
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
02-14-2003 02:00 AM
02-14-2003 02:00 AM
mailing a file using mailx
HP/UX 10.20
Can Anyone give us a nice easy way of mailing out a file, or the contents of a file, from our HP server to root (this then is forwarded to a list of users)? Ideally we would like to write a simple script that we could schedule, maybe via cron??
Any suggestions please.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 02:04 AM
02-14-2003 02:04 AM
Re: mailing a file using mailx
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 02:06 AM
02-14-2003 02:06 AM
Re: mailing a file using mailx
Then to mail a file say fileA.
do
cat fileA|mailx -s "subject" root@hostname
have this line in your scripts in cron and that will take care of it.
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 02:11 AM
02-14-2003 02:11 AM
Re: mailing a file using mailx
One of the best on this
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xd81f36e69499d611abdb0090277a778c,00.html
Also the hp doc
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062922158
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 06:20 AM
02-14-2003 06:20 AM
Re: mailing a file using mailx
which could also be located in /etc/mail/sendmail.cf
uncomment the "DS" option and make sure that you also have the fully qualified domain name of your smtp server after it. i.e.:
DS mailserver.mydomain.com
then
cat file | mailx -s "subject" -r return_address address_to_send_to
or
mailx -s "subj" -r return_address address_to_send_to < file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 07:28 AM
02-14-2003 07:28 AM
Re: mailing a file using mailx
What about of sendmail command? The sendmail command is more customizable, Just try this:
1) When message is inside of body mesage:
Set a variable that contain the body text, i.e:
BODY=`cat file_of_body_text`
echo "Importance: High\nSubject: Test mail\n\n$BODY"|sendmail user_box@domain
This result in an email with High Priority Flag, Subject: "Test mail" and a body text.
2) When message is an attached file:
(echo "Importance: High\nSubject: Test mail\n\n$BODY";uuencode attached_file attached_file)|sendmail user_box@domain
Note: attached_file must be twice!
This result in an email with High Priority Flag, Subject: "Test mail" with an attached file. Also you can use "C.C:" and "From:" fields.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 08:10 AM
02-14-2003 08:10 AM
Re: mailing a file using mailx
for ADDY in `cat /PATH/ADDYFILE`
do
uuencode /PATH/FILE /PATH/FILE|mailx -s "subject" $ADDY
done
This attaches the FILE as a MIME compliant attachment (for .csv's, .txt's and others) and sends it to every email address in ADDYFILE. Its quick, dirty and works like a charm. We do it every day here.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 04:14 AM
02-17-2003 04:14 AM
Re: mailing a file using mailx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 04:41 AM
02-17-2003 04:41 AM
Re: mailing a file using mailx
Charles Kingsley - Westward Ho! in 1855:
???there are more ways of killing a cat than choking it with cream???.
Mark Twain, "A Connecticut Yankee in King Arthur???s Court", 1889
???she was wise, subtle, and knew more than one way to skin a cat???
"Way down East; or, Portraitures of Yankee Life, Seba Smith of about 1854:
???This is a money digging world of ours; and, as it is said, ???there are more ways than one to skin a cat,??? so are there more ways than one of digging for money???
First recorded in John Ray???s collection of English proverbs as far back as 1678.
Some writers have pointed to its use in the southern states of the US in reference to catfish