LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   command-line email sending (https://www.linuxquestions.org/questions/linux-software-2/command-line-email-sending-48411/)

ixion 03-05-2003 10:21 AM

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.

Tinkster 03-05-2003 01:12 PM

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

Cheers,
Tink

ixion 03-05-2003 01:43 PM

where should I read up on mime-encoding? What is it?! ;)

Tinkster 03-05-2003 01:45 PM

man -k mime :P

Cheers,
Tink

rnturn 03-05-2003 11:28 PM

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

ixion 03-06-2003 11:16 AM

awesome! Thanks for the suggestion!

I'm anxious to see what you come up with :)

rnturn 03-06-2003 06:14 PM

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

ixion 03-07-2003 06:33 AM

Awesome!!! Thank you so much!!!

ixion 03-07-2003 06:55 AM

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;)

neioo 08-01-2008 06:46 AM

Quote:

Originally Posted by rnturn (Post 241139)
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 :)]


All times are GMT -5. The time now is 03:41 PM.