LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Cheers,
Tink
 
Old 03-05-2003, 11:28 PM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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: 25

Rep: Reputation: 3
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration