LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 01-23-2007, 10:07 AM   #1
ddzc
Member
 
Registered: Oct 2003
Location: T.O
Distribution: SunOS 10
Posts: 97

Rep: Reputation: 15
Sending mail from Comman line


Hey guys,

I need to send an email with an attachment via the comman line in Linux Redhat. If im in the directory of the file that I want attached, whats the command I execute to send that file to an email address? The box is a sendmail server.

I tried the following command but it just hangs.

sendmail /a "\home\users\name\attachmentfiles" blah@blah.com email attachment

thx

Last edited by ddzc; 01-23-2007 at 10:23 AM.
 
Old 01-23-2007, 10:23 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: OpenSUSE 12.1 CentOS 6.2
Posts: 9,010

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
I had the same problem sometimes ago, and I found no simple solutions using sendmail. So I used the uudeview decoder/encoder (look for the RPM) in the following way (inside a script):

Code:
email="pippo@anydomain.it"
subject="test mail with attachment"
reply="pluto@anydomain.it"
from="pluto@anydomain.it"

uuenview -m $email -f "$from" -r "$reply" -s "$subject" -a $file.tar.gz << EOF

Greetins,
any text here
(see attach file.tar.gz)

EOF
In this case the file.tar.gz will be properly encoded, attached to the mail and sent succesfully!

Last edited by colucix; 01-23-2007 at 10:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to access WAN fromm comman line trelos Linux - Networking 1 06-20-2006 04:52 PM
A good comman line mp3 media player Unicron Linux - Software 3 06-07-2006 06:35 PM
Sending mail from command line matiasquestions Linux - Software 5 01-22-2006 11:51 AM
sending mail from command line won't work disorderly Linux - General 2 06-09-2005 11:29 AM
deleting a file via comman line PionexUser Linux - General 2 09-17-2003 12:27 AM


All times are GMT -5. The time now is 05:54 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration