Solved

How to send email in Unix command line

Posted on 2011-03-15
2
559 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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.

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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now