Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email using elm command

Status
Not open for further replies.

unixwhoopie

Programmer
May 6, 2003
45
0
0
US
I am using elm command to email a file from my script. This file is in regular format and not in a zipped format. However, the file goes in the body of the email instead of as a seperate attachment.

elm -s "Test Mail" my_email@yahoo.com < /dir/file.txt

How can I send it as a seperate attachment?

Thanks
 
You might try:

uuencode /dir/file.txt file.txt | elm -s "Test Mail" my_email@yahoo.com

 
Thanks ZaSter...that seems to be working...However I am not sure where to include the body of the email in this syntax...

Thanks
 
(cat mailtext; /dir/file.txt file.txt) | mail -s "Test Mail" my_email@yahoo.com

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks for the response...

I added uuencode to your command. When I use this it says invalid option -s

(cat mailtext; uuencode /dir/file.txt file.txt) | mail -s "Test Mail" my_email@yahoo.com

When I change this from -s to -t, the email goes fine along with the attachment. However, the subject (Test Mail) is not sent, and instead, the email is also sent to Test@yahoo.com and Mail@yahoo.com

How can I fix this. Also, If I have to send multiple attachments, how can I modify the syntax?

Thanks
 
Code:
(echo "Subject: Test Mail"; cat mailtext; uuencode /dir/file.txt file.txt) | mail my_email@yahoo.com

for multiple attachments, replicate the 'uuencode /dir/file.txt file.txt' part accordingly.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top