Link to home
Start Free TrialLog in
Avatar of jay8142
jay8142

asked on

Using sendmail at the command line

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
Avatar of ozo
ozo
Flag of United States of America image

sendmail -v jcj@tiac.net < test.txt
ASKER CERTIFIED SOLUTION
Avatar of rkuethe
rkuethe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rkuethe
rkuethe

How about:

mail -f myfile.txt

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

rkuethe, i'm afraid      mail -f myfile.txt
is to extract mail from an alternate mailbox called myfile.txt
Try this from the UNIX command line:

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