Ok i wish to do this on a Linux box..
I need to be able to receive a sms message (it will no doubt arrive by email) and then act upon it..
so for instance.. a message comes in with a date, time and name.. then i need to export that information to a sql database.
any开发者_运维知识库 ideas anyone on a quick and easy solution to this.. I think I have the sms gateway sorted now as I will get the software from the gateway to convert the sms messages to email but its the whole how to integrate with the email side of things what has given me a headache..
If you control your own machine you can configure it to pipe the e-mail through a filter. Simplest would be to setup a new account and setup a .forward
or alias.
The following examples are for Sendmail, but (all?) Unix e-mail programs offer a similar service.
Setting up an alias (option 1)
Look in the directory /etc on your server for your alias file. Add the line:
script: "|/path/toyourscript/pipe.php"
Using a .forward
file (option 2)
Create a .forward file in your main home directory.
"|/path/toyourscript/pipe.php"
or:
myemail@example.com,"|/path/toyourscript/pipe.php"
If you are on shared hosting then most hosting providers also provide the possibility to "pipe" e-mails received to a particular account through a script instead of storing them in a mailbox. Check the CPanel setup.
精彩评论