?
Solved

How to send email in Unix command line

Posted on 2011-03-15
2
Medium Priority
?
603 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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