Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-21-2017, 10:36 AM
|
#1
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Rep:
|
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.
|
|
|
06-21-2017, 10:41 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,009
|
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.
|
|
|
06-21-2017, 11:00 AM
|
#3
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
I figured since Powershell can do it Linux can too
|
|
|
06-21-2017, 11:06 AM
|
#4
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
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.
|
|
|
06-21-2017, 11:07 AM
|
#5
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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
Last edited by schneidz; 06-21-2017 at 11:11 AM.
|
|
|
06-21-2017, 11:22 AM
|
#6
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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).
|
|
|
06-21-2017, 11:27 AM
|
#7
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
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
|
|
|
06-21-2017, 11:32 AM
|
#8
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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 ?
|
|
|
06-21-2017, 11:36 AM
|
#9
|
Moderator
Registered: Aug 2002
Posts: 26,272
|
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.
|
|
|
06-21-2017, 02:02 PM
|
#10
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep:
|
@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
|
|
|
06-21-2017, 02:10 PM
|
#11
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
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.
|
|
|
06-21-2017, 02:39 PM
|
#12
|
Moderator
Registered: Aug 2002
Posts: 26,272
|
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
|
|
|
06-21-2017, 06:09 PM
|
#13
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.4
Posts: 5,816
|
Quote:
Originally Posted by michaelk
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?
|
|
|
06-21-2017, 08:55 PM
|
#14
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Is the message sent by cellular modem? How does it get into the cell network?
|
|
|
06-21-2017, 09:40 PM
|
#15
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.4
Posts: 5,816
|
Quote:
Originally Posted by AwesomeMachine
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 07:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|