Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am looking something like this on dummy comp, sending email fast without any login. I mean that I do not want to set up any .muttrc or any other settings. I want just a short msg to person A from noReply@something.com. Is it possible and how?

sendMail -r A@gmail.com -msg "I am coming, x"

sendmail -r B@gmail.com -msg "here is the project" -a file.tgz

Is there any easy-to-use -unix-program for this kind of spontaneuous communication (without any extra hassle)?

[Update]

Suppose that I have only Network connection to the internet, now I want to send a msg fast to my friend to some email XYZ. I can ping it and I can use morse. Can I combine morse/ping to transmit msg to my friend? Or is there some easier way to transmit a msg without hassle to set up all kind of postfix etc? If there was some service that collected all morse-ping msgs and then sent them to emails -- yes then it would be possible, investigating.

share|improve this question
add comment

3 Answers

Yes, you can use the mail command of your unix system just type:

mail -s "Your subject" your_mail@domain.com
Your message

.

Don't forget to finish your mail with a last line with '.' .

In order to delivery the mail you have to configure your MTA (postfix, sendmail) to use for example an SMTP relay and configure the localdomain of the sender.

Tips: You can also use this command of course:

mail -s "Your subject" your_mail@domain.com <<EOF
The text of your mail
Another line
EOF
share|improve this answer
    
On random comps, This is suppose that you not have the root permission ? –  almorel Nov 20 '11 at 19:55
    
@hhh Due to the enormous amount of spam out there, mail servers typically want you to identify yourself in some way. In particular, mail servers don't normally accept relaying, i.e. transmitting a mail from outside their domain to outside their domain. The simplest way would be to use a webmail service (which does require authentication). –  Gilles Nov 20 '11 at 20:27
    
@Gilles: this kind of msgs to be sent has also a very short life-time in itself... –  user2362 Nov 20 '11 at 20:38
    
@hhh For messages with a short lifetime, there's chat. But again the trend is towards authenticating participants, i.e. you need to log in. –  Gilles Nov 20 '11 at 20:41
add comment

In the most simple case you have to specify a mail-relay - somehow.

IMHO this should be possible on the command line but I did not find any direct hints for that on the mailx-man-page.

I personally do use a standard setup for postfix as local MTA. This standard setup uses "mailrelay" without DNS resolution as mail-relay. After this I just have to put an IP-alias for mailrelay into my servers and this is all. After that I can use mailx and send mails directly. But for this I have to setup postfix and /etc/hosts - which is not, what you seem to want.

share|improve this answer
    
I am not sure. I am looking for the barest minimum settings to send some email. I have earlier used mutt but now with fresh boxes, I am looking for some simple way to do things ... without too much hassle send an email. –  user2362 Nov 20 '11 at 20:58
    
...I cannot understand how to end msg with this method. mailx ... EOT, does not finish it. When I try this, I get a lot of undelivered msgs. –  user2362 Nov 20 '11 at 21:14
    
echo Test MAil | mailx -s "test" your.destination.com EoF should therefore do (control-D). Or use pine/mutt... –  Nils Nov 21 '11 at 22:14
add comment

How about the talk command? If you just want to converse easily and it doesn't need to be email then this might suit your needs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.