Solved

How to send email in Unix command line

Posted on 2011-03-15
2
585 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
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

808 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