Solved

Using sendmail at the command line

Posted on 1998-12-11
5
376 Views
Last Modified: 2010-04-21
What is the commandline format to send a text file using sendmail? In linux, I want to send a file named test.txt to jcj@tiac.net. If I use "sendmail -v jcj@tiac.net", I can then enter the message and it reaches the end person. How can I send the premade file. I've done this in the past but have forgotten the command line syntax. Thank you
jcj@tiac.net
0
Comment
Question by:jay8142
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2008393
sendmail -v jcj@tiac.net < test.txt
0
 

Accepted Solution

by:
rkuethe earned 50 total points
ID: 2008394
Try this, this will put the text of "mail.txt" into the message body, still looking into how to send it as an "attachment"

sendmail -v jcj@tiac.net </export/home/jcj/mail.txt        
0
 

Expert Comment

by:rkuethe
ID: 2008395
How about:

mail -f myfile.txt

then follow prompts:
Subject, recipient, etc.
"Ctrl-D" to end message.

0
 
LVL 1

Expert Comment

by:toTo
ID: 2008396
rkuethe, i'm afraid      mail -f myfile.txt
is to extract mail from an alternate mailbox called myfile.txt
0
 

Expert Comment

by:rballen
ID: 2008397
Try this from the UNIX command line:

( cat /tmp/a ; uuencode /tmp/a file.txt ) | sendmail rallen@devifx1
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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.:
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.

708 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

14 Experts available now in Live!

Get 1:1 Help Now