LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
Search this Thread
Old 03-05-2003, 10:21 AM   #1
ixion
Member
 
Registered: Dec 2002
Location: USA
Distribution: SuSE, CentOS, Gentoo
Posts: 166

Rep: Reputation: 30
command-line email sending


we need to be able to send an attachment to various email addresses through rsh remotely. What would be a command-line mail program/package/etc. that will send an email with an attachment to an email address without any user input.

example: 'rsh <server> <mail program> <attachment> <emailaddress>', and with just one command line the email is off and away. Any chance of this working? I don't mind what config is involved, we just need this to work.
 
Old 03-05-2003, 01:12 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
well, you'll obviously have to do mime-encoding yourself,
but after that use sendmail...

Cheers,
Tink
 
Old 03-05-2003, 01:43 PM   #3
ixion
Member
 
Registered: Dec 2002
Location: USA
Distribution: SuSE, CentOS, Gentoo
Posts: 166

Original Poster
Rep: Reputation: 30
where should I read up on mime-encoding? What is it?!
 
Old 03-05-2003, 01:45 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
man -k mime :P

Cheers,
Tink
 
Old 03-05-2003, 11:28 PM   #5
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 905

Rep: Reputation: 45
Re: command-line email sending

Quote:
Originally posted by ixion
we need to be able to send an attachment to various email addresses through rsh remotely. What would be a command-line mail program/package/etc. that will send an email with an attachment to an email address without any user input.

example: 'rsh <server> <mail program> <attachment> <emailaddress>', and with just one command line the email is off and away. Any chance of this working? I don't mind what config is involved, we just need this to work.
Mutt. It does attachments quite nicely.

Something like:

rsh server /usr/bin/mutt -s "Here's the stuff" -a attachment.file smithj@domain < /dev/null

should work. Dunno about that redirect working correctly with rsh, though. I can test it tomorrow (on a system that allows rsh). Let you know then.

Good luck...

Rick
 
Old 03-06-2003, 11:16 AM   #6
ixion
Member
 
Registered: Dec 2002
Location: USA
Distribution: SuSE, CentOS, Gentoo
Posts: 166

Original Poster
Rep: Reputation: 30
awesome! Thanks for the suggestion!

I'm anxious to see what you come up with
 
Old 03-06-2003, 06:14 PM   #7
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 905

Rep: Reputation: 45
Quote:
Originally posted by ixion
I'm anxious to see what you come up with
Worked like a charm... even the redirection from /dev/null.

Hope that'll help...

Rick
 
Old 03-07-2003, 06:33 AM   #8
ixion
Member
 
Registered: Dec 2002
Location: USA
Distribution: SuSE, CentOS, Gentoo
Posts: 166

Original Poster
Rep: Reputation: 30
Awesome!!! Thank you so much!!!
 
Old 03-07-2003, 06:55 AM   #9
ixion
Member
 
Registered: Dec 2002
Location: USA
Distribution: SuSE, CentOS, Gentoo
Posts: 166

Original Poster
Rep: Reputation: 30
I've been working with it on the Suse 8.0 server we have, but keep getting this error when using '/dev/null':

Error sending message, child exited 65 (Data format error.).
Could not send the message.

Is the Suse system not setup properly??

edit: /dev/null does exist

Last edited by ixion; 03-07-2003 at 06:56 AM.
 
Old 08-01-2008, 06:46 AM   #10
neioo
LQ Newbie
 
Registered: Jan 2008
Location: Sant Quinti de Mediona
Distribution: Gentoo
Posts: 24

Rep: Reputation: 2
Smile

Quote:
Originally Posted by rnturn View Post
Mutt. It does attachments quite nicely.

Something like:

rsh server /usr/bin/mutt -s "Here's the stuff" -a attachment.file smithj@domain < /dev/null

should work. Dunno about that redirect working correctly with rsh, though. I can test it tomorrow (on a system that allows rsh). Let you know then.

Good luck...

Rick
Thank you! this is what I was looking for
[Well your solution was posted some years ago, but I just wanted to thank you ]
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an attachment from a command line RonnyNussbaum Linux - Software 12 06-04-2007 11:47 AM
sending mail from command line won't work disorderly Linux - General 2 06-09-2005 11:29 AM
command-line for sending email with attachment? enemorales Linux - Software 3 10-06-2004 08:04 AM
sending msgs thru command line citrus Linux - Software 3 04-13-2004 02:39 AM
Sending Email's from command line jlaruffa Linux - Newbie 0 06-04-2003 03:31 PM


All times are GMT -5. The time now is 07:09 AM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration