This question already has answers here:
Receive SMS messages in a web application in the US on a hosted server
(5 answers)
Closed 8 years ago.
I will be setting up a website hosted on GoDaddy in the near future. However, one of the key components to making this website work is it's reliance on text messages coming from my phone. I will use SMS messaging to text my server with specific updates (example: "on route," "no longer delivering," etc). The idea is I text a specific address and the server updates a text file with the specific information from the text message from my phone. Then, when someone goes to the website, it will pull data from the text file to determine the current status and act from there.
How would I set up such a service through a web hosting server? I am familiar with HTML, PHP, and JavaScript, but won't mind learning another language if necessary.
You may be able to use google voice to receive sms messages. You may be able to receive them using pop, imap or xmpp (with varying flexibility on receiving. You would need to have something running on your host provider independent of the web server (or somehow trigger a web page to poll at regular intervals). This would depend on your hosting provider.
Update: I googled for "google voice receive text" and received step by step instructions on how to receive text messages via google voice to email. All you would need to do is connect to gmail (e.g. once per minute) to check if any messages have been received, using imap or pop (you may need to enable imap on gmail too).
Twilio has a cheap, easy-to-use API for SMS messages.
Check it out here.
Related
I have special e-mail accounts on my web server (#mydomain.com). I want to run a php script automatically when one of these accounts get a new e-mail. For example: when info#mydomain.com address receives a mail, I want to run "receivedMail.php" file and read this new e-mail. I don't know where I will start or how can I do this.
You're wanting to pipe email received for a specific email address to a PHP script.
If your webhost has cPanel, this makes it very easy to setup. See:
http://kb.siteground.com/how_to_pipe_an_email_to_a_php_script/
Alternatively, if you don't have cPanel but have Exim mailserver, this will guide you on how to do this:
http://www.phpshare.org/articles/Piping-Incoming-Mail-with-PHP
Hope this helps!
You have to create a cron job calling your php file every 1 minute for exemple.
The script have to the derver and read the email.
This has nothing to do with web servers directly, Since web servers do not receive emails. So no .htaccess style files come into play. The email is received by a mail server, so that is where you have to get active. Two strategies are possible:
you use the possibilities to trigger an action as offered by your
mail server (typically the smtp server you operate). That obviously
depends on which mail server you operate, different software offers
different features.
you poll those email accounts on a regular base, using a standard protocol like POP3 or IMAP4. You can do this using any suitable client. When a new message is found whilst polling the account, then you trigger the action you wish.
Option 2. is probably easier to start with. So give it a try: create a php file which polls your email server. You can use the imap php extion for this, it supports all important email protocols. The extensions allows to easily detect and retrieve new messages. For each such message you can implement whatever action you wish. All that is left is to run this script on a regular base, say every 3 minutes, which is typically done using a cron system. There are many examples for this out there on google...
Have fun!
I have set up many push notifications in iOS projects. I always receive the same message which I have sent from my application, all going well.
But when I change my server from my local machine (or a dedicated server) to web hosting the message format changes somewhat. For which we are not accepting.
Sample message from our server:
{"msg":"match found !","match_id":"34","rqst":"1"}
Sample message from web hosting server (remote server) :
{\"msg\":\"Match found !\",\"match_id\":\"34\",\"rqst\":\"1\"}
It contains extra backslashes before and after every string.
FYI we are using Slim Framework with PHP MySQL APIs, and the messages sent are JSON.
Use PHP to get ride of the slashes before sending the message.
<?php stripslashes($YourMessage); ?>
I have a number of phones on my network and I would like to be able to send a number to one based on extension for it to dial.
I have looked into TAPI and the PHP COM events but I don't understand it all that well and how to apply it to my setup.
Does anyone have any experience with using PHP to send commands to an IP phone on their network?
If these are Cisco IP Phones you can look at using the Ip Phone Services API: http://developer.cisco.com/web/ipps
Look specifically at "Dial" Telephony URI in the Application Development Notes
Each IP phone has a web server on it, you can use standard http(s) posts to send XML commands to the phone. You can completely control the phone in this manner.
You have to understand that client-server communication is a bit unidirectional. From iPhone to server you can easily send messages (and get responses), but to send a message from server to iPhone you have to implement socket connection between them, so the iPhone will always "listen" to what the server is "saying". Also, push notifications are a way to send messages from server to device, but it's not your case, I guess.
I have developed a CRM that is used with a marketing website similar to manta.com. The CRM has a built-in email client. Basically it matches names and emails to addresses on file, and if the email is from a customer it loads their account information next to the email.
The entire system works, but is in some cases slow. Because each "region" of the country is managed by a different company, the software connects to several different mail servers, all of which behave differently.
In some cases (mostly with godaddy servers) it takes a very long time to send an email. It also takes a long time to load the inbox if they have a lot of messages (500+), even if it is paged.
I am using pear Mail::Factory smtp to send, and the built in php imap functions to receive.
I am thinking for outgoing messages I will just store the emails into a db and then have a cron script send it out, then they can send their email and move on right away.
Does anyone have any ideas/concepts for handling large inboxes via IMAP and php? I will have no control over the mail servers themselves, but have full control over the server that the CRM is on.
I am not looking for code, just concepts if you have them.
It is Linux (ubuntu), apache, mysql, php. I can use Zend if needed.
It looks like a combination of caching the emails and using the imap_fetch_overview function which omits the body of the email. This seems to eliminate any issues with the lag. I can also use it to page the results so I am only loading a small number (25-50) at a time. Thanks for the help.
How would i make an aol aim bot in php, that is able to send and receive message, with a autoresponder. I have already taken a look at the toc protocol but wanted to use oscar if possible.
I can't speak as to specific protocols, but the only architecture you can use for this is to have a daemon running on the server that holds the connection to the IM server open and logged in, and also has a channel/socket open on the server listening to PHP scripts that make a connection to it in order to send and receive messages.