LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to send message via terminal in windows or linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-send-message-via-terminal-in-windows-or-linux-848746/)

tailinlinux 12-06-2010 06:16 PM

How to send message via terminal in windows or linux?
 
How to send message via terminal in windows or linux?

wideyes 12-06-2010 06:57 PM

That's a bit vague. To whom do you want to send the message? Is your recipient on a desktop pc?

mikewc02 12-08-2010 03:46 AM

As wideyes mentioned, this question is quite vague. Also, Windows and Linux work completely differently. (Please note, though, that this is a Linux-specific forum.)

In Linux, if you are attempting to broadcast a message out to all other users logged into a particular machine, you can do so with the "wall" command.

Example:
Code:

# wall Text of your message
The "write" command does the same thing, but will allow you to send target the message to a particular user, rather than broadcasting out to everyone.

Sending messages to users in Windows is done through Task Manager. Task Manager has a tab called "Users" that will allow you to select a user who is currently logged in and send them a pop-up message by selecting the "Send Message" button at the bottom.

Now... if you're talking about sending emails from the command line, that can be done easily if you already have a mail agent (like Sendmail) installed and configured. To send an email with Sendmail, you would do it as follows.

Code:

# mail -s "Subject of email" recipient@theirdomain.com
After this, your cursor will move to a blank line. You will type the text of your email here, just as you would in a text editor. When completed, hit Ctrl+D. You'll be presented with a CC: line, and if you need to copy anyone, you will list their email address here. (If not, just leave it blank.) When you hit enter again, your message will be sent.

If you don't have Sendmail, Postfix, or whatever installed, you can also send an email by establishing a telnet connection to your mail server on port 25. Below is an example of me doing so through my ISP's mail server. (Email and IP addresses in output have been changed. The text in bold is what I typed.)

Code:

[mike@myserver ~]$ telnet mail.charter.net 25
Trying 209.225.8.224...
Connected to mail.charter.net (209.225.8.224).
Escape character is '^]'.
220 imp09 smtp.charter.net ESMTP server ready 20101208 043401
helo gmail.com
250 imp09 hello [75.126.162.205], pleased to meet you
mail from:myemail@gmail.com
250 2.1.0 <myemail@gmail.com> sender ok
rcpt to:therecipient@gmail.com
250 2.1.5 <therecipient@gmail.com> recipient ok
data
354 enter mail, end with "." on a line by itself
This is the text of my email.
.

250 2.0.0 Message received: 20101208093453.DLKN4190.mta31.charter.net@imp09 E0000

The telnet method works in either Linux or Windows.


If none of this answers your question, you will need to be more specific as to exactly what it is that you are trying to do.

tailinlinux 12-09-2010 07:24 PM

Quote:

Originally Posted by mikewc02 (Post 4184447)
As wideyes mentioned, this question is quite vague. Also, Windows and Linux work completely differently. (Please note, though, that this is a Linux-specific forum.)

In Linux, if you are attempting to broadcast a message out to all other users logged into a particular machine, you can do so with the "wall" command.

Example:
Code:

# wall Text of your message
The "write" command does the same thing, but will allow you to send target the message to a particular user, rather than broadcasting out to everyone.

Sending messages to users in Windows is done through Task Manager. Task Manager has a tab called "Users" that will allow you to select a user who is currently logged in and send them a pop-up message by selecting the "Send Message" button at the bottom.

Now... if you're talking about sending emails from the command line, that can be done easily if you already have a mail agent (like Sendmail) installed and configured. To send an email with Sendmail, you would do it as follows.

Code:

# mail -s "Subject of email" recipient@theirdomain.com
After this, your cursor will move to a blank line. You will type the text of your email here, just as you would in a text editor. When completed, hit Ctrl+D. You'll be presented with a CC: line, and if you need to copy anyone, you will list their email address here. (If not, just leave it blank.) When you hit enter again, your message will be sent.

If you don't have Sendmail, Postfix, or whatever installed, you can also send an email by establishing a telnet connection to your mail server on port 25. Below is an example of me doing so through my ISP's mail server. (Email and IP addresses in output have been changed. The text in bold is what I typed.)

Code:

[mike@myserver ~]$ telnet mail.charter.net 25
Trying 209.225.8.224...
Connected to mail.charter.net (209.225.8.224).
Escape character is '^]'.
220 imp09 smtp.charter.net ESMTP server ready 20101208 043401
helo gmail.com
250 imp09 hello [75.126.162.205], pleased to meet you
mail from:myemail@gmail.com
250 2.1.0 <myemail@gmail.com> sender ok
rcpt to:therecipient@gmail.com
250 2.1.5 <therecipient@gmail.com> recipient ok
data
354 enter mail, end with "." on a line by itself
This is the text of my email.
.

250 2.0.0 Message received: 20101208093453.DLKN4190.mta31.charter.net@imp09 E0000

The telnet method works in either Linux or Windows.


If none of this answers your question, you will need to be more specific as to exactly what it is that you are trying to do.

using wall i cant send message.. into other user how to know if they received or see my message,

GrapefruiTgirl 12-09-2010 07:50 PM

Quote:

Originally Posted by tailinlinux (Post 4186555)
using wall i cant send message..

What does "cant" mean? What happens when you use `wall` command? It doesn't work? Show us the error message. What is the problem with it?
Quote:

how to know if they received or see my message,
This I cannot answer. I suppose, wait and see if they send a message back? (I hope `wall` or `write` works for them..)

How about `write`? Did you try that?


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