Solved

How to send email in Unix command line

Posted on 2011-03-15
2
598 Views
Last Modified: 2012-05-11
Can someone tell me the command I can use to send myself a test email from the Unix command line?  I also need the ability to attach a small text file that is in the same directory from which I will be running the command.  

I will be using localhost as the SMTP server and no authentication is needed.
0
Comment
Question by:jbaird123
[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
2 Comments
 
LVL 3

Accepted Solution

by:
Alberto Cortes earned 500 total points
ID: 35141847
Solution:

to send email in Unix prompt using mail:
cat $FILE | mail -s "This is the subject" somebody@email.address

to send email in Unix prompt using mailx:
cat $FILE | mailx -s "This is the subject" somebody@email.address

remember that you need to configure sendmail (/etc/mail/sendmail.mc) and define your SMTP provider, before this can be successful.
0
 

Author Comment

by:jbaird123
ID: 35142002
Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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