Solved

Using sendmail at the command line

Posted on 1998-12-11
5
399 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
[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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
SSH commands for Nas4free 21 544
problem creating new luks volume on new VM disk 5 126
Access_log 17 183
Control Number of Log Files -Perl 7 102
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…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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.:
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.

734 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