LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Send text via Linux (https://www.linuxquestions.org/questions/linux-newbie-8/send-text-via-linux-4175608319/)

trickydba 06-21-2017 09:36 AM

Send text via Linux
 
Is it possible to send a text to a mobile device from Linux command line?
This is what I used but I'm not getting the text:
Code:

echo "enter message body here" | mailx -s "email subject" recipient@email.com mobilenumber@vtext.com
I've tried to a Verizon phone and a Sprint phone. Neither got the text.

pan64 06-21-2017 09:41 AM

you can send an email only to an email address, not a device.
But I think in your case there is no mail server to handle your request.

trickydba 06-21-2017 10:00 AM

I figured since Powershell can do it Linux can too

r3sistance 06-21-2017 10:06 AM

Saying can Linux send a message to a phone isn't really giving much of what you want to do. Are you looking to send an SMS? Are you looking to send an e-mail (in which case a mobile phone is no different) or perhaps use some form of IM? Asking can Linux connect to a phone (which itself maybe running linux!) is too much of a generic question.

schneidz 06-21-2017 10:07 AM

it should work. you'd have to know how to format the email address so that the telefone company forwards it to the correct mobile number (all the major telco's have different domain names).

not sure how outdated this mite be:
http://www.wikihow.com/Send-a-Text-from-Email

schneidz 06-21-2017 10:22 AM

i wonder if your server is configured for smtp/sendmail or whatever.
i know with comcast they blacklist users not paying for their business speed from spamming emails (regardless of powershell vs. bash).

trickydba 06-21-2017 10:27 AM

I can do this successfully in Powershell(yuck). I used the appropriate domain names too. I am trying to send a SMS, but I call it text. Sorry for the confusion

schneidz 06-21-2017 10:32 AM

your not really troubleshooting this well which is causing us to go on wild goose chases.

what email service are you using to send out emails in powershell / what email service are you using to send out emails in linux command-line ?

are you able to receive email from regular email addresses (e.g.- @yahoo, @aol, @gmail, ...) from the linux command-line ?

michaelk 06-21-2017 10:36 AM

Yes, you can send a SMS text message to a phone via email. As stated if your system is not configured for outgoing mail the posted command will not work.

The quickest way might be to use a command line email client that connects to your email server using your email credentials. Most email providers provide the authentication methods, ports etc to manually configure a client and they can be saved to a configuration file if desired. mutt and alpine are the most common command CLI clients.

trickydba 06-21-2017 01:02 PM

@schneidz.......PowerShell(yuck) uses Send-MailMessage cmdlet, Linux I tried using MailX. Yes I am able to send emails using regular email addresses.

@michaelk.......My system is configured for outgoing mail

273 06-21-2017 01:10 PM

So you do not have Outlook on the machine but are able to send email?
As stated above, you need a command-line email client and the correct configuration files to send email.
I would be surprised if the Windows machine does not have Outlook configured.

michaelk 06-21-2017 01:39 PM

As far as I know it should work and the basic syntax for Verizon is:

Code:

echo "Hello World" | mailx -s "message Subject" 10_digit_phone_number@vtext.com

scasey 06-21-2017 05:09 PM

Quote:

Originally Posted by michaelk (Post 5725281)
As far as I know it should work and the basic syntax for Verizon is:

Code:

echo "Hello World" | mailx -s "message Subject" 10_digit_phone_number@vtext.com

Just tested that syntax and it worked for me...received a SMS message on my Verizon phone.

Tried with two email addresses, as the OP showed, and both the actual email address and the phone received the message.
Question to the OP, does the "recipient@email.com" get the email?

AwesomeMachine 06-21-2017 07:55 PM

Is the message sent by cellular modem? How does it get into the cell network?

scasey 06-21-2017 08:40 PM

Quote:

Originally Posted by AwesomeMachine (Post 5725379)
Is the message sent by cellular modem? How does it get into the cell network?

The syntax as posted by michaelk in #12 will send a (SMS) message to the 10-digit cell number on Verizon Wireless.

Repeating:
Question to the OP, does the "recipient@email.com" get the email?


All times are GMT -5. The time now is 11:03 AM.