Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

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
0
jay8142
Asked:
jay8142
1 Solution
 
ozoCommented:
sendmail -v jcj@tiac.net < test.txt
0
 
rkuetheCommented:
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
 
rkuetheCommented:
How about:

mail -f myfile.txt

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

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

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

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now