Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can i simply email a file from within unix shell script please

Posted on 2011-02-13
7
Medium Priority
?
639 Views
Last Modified: 2013-12-26
Hi i would like to know how i can email the file /tmp/test.xml  from withing my shell script please, please note here i have very little knowledge of unix commands.

Thanks in advance
0
Comment
Question by:cghrmauritius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 14

Accepted Solution

by:
Dushyant Sharma earned 2000 total points
ID: 34885866
$mail -s "Report 05/06/07" boss@yahoo.com < demo.txt

http://www.cyberciti.biz/faq/howto-write-command-to-send-receive-mail/
0
 
LVL 14

Expert Comment

by:Dushyant Sharma
ID: 34885868
here -s "report 05/06/07" is the subject
boss@yahoo.com is the address to send the mail
demo.txt is the file to be sent. in your case it will be /tmp/test.xml
0
 

Author Comment

by:cghrmauritius
ID: 34885892
Hi thanks for the quick responce yes this did send me the email with the file as part of the body.


How do i get it to send the file as an attachment please instead of in the body?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:Dushyant Sharma
ID: 34885916
0
 

Author Comment

by:cghrmauritius
ID: 34885982
sorry i know i'm a bit thick when it comes to unix commands and i hope you can be a bit more specific as i dont really understand those links

if i use the email command it says command not found

and if i use the uuencode i get

./search_with_ref_input.sh: line 21: uuencode: command not found
Null message body; hope that's ok

please help with code rather than a link sorry to be a pest but i am a newby at unix
0
 
LVL 14

Expert Comment

by:Dushyant Sharma
ID: 34886089
try this

email -s "this is subject" -a /tmp/test.xml user@domain.com < "Hey this is some body content"
0
 

Author Closing Comment

by:cghrmauritius
ID: 34887069
Tanks for your help in the end i used mutt as this was installed on the server and it serves the purpose
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question