How can my website receive email from a mobile phone? - php

I want to receive emails from mobile phone and display it on my website implemented PHP.
My site is a free messaging system that sends messages to mobile phones using sendgrid API
I want to display messages from cell phones on my website. Is there any API available ?

You don't need any APIs to do this task. What you need is to setup mail server on your server to be able to receive emails. It's nothing difficult in sms to emails. It's absolutely identical to regular emails. So you should setup your mail server to call your receiver script which will process the email, insert into your database etc. Take a look at exim or qmail.
How it will work:
your website sends email to, lets say, 91700000001#vtext.com from user#yourwebsite.com
91700000001 replies to user#yourwebsite.com that goes to your mail server
you have filter on your mail server to check, for example, if emails came from carriers domain (vtext.com, att.com etc), and hit your receiver script
the receiver scripts gets an email, parse it, inserts into the database
your display the data from the db on your website

Email from mobile? Do you meant text (sms)? Every mobile phone can receive email if they have internet connection. Your question is not very clear, can you rewrite your question to understand very clearly.

SMS GupShup
GupShup Apps platform will allow you to create sms applications that will allow your website to interact with your system.
Check out the FAQ first to see if it meets your requirement.
Then check the requirements for creating your application.
You can find the list of APIs here.
Sample Code (click on Quote App in PHP on extreme left.)

Related

Notifications To Mobile Devices

In PHP if I save the users mobile number into my phpmyadmin database and want to push certain notifications to the users phone I would have to email them at that specified number. How would you go about determining the users carrier to email such as #vtext.com or #at&temail.com or #virginmobile.com ect. How would I determine the ending email to send to? I know there are sites online that can determine this already for you which I can possibly send a curl request to and fetch the carrier it displays on the screen but how do these sites specifically determine these carriers? If they can determine it so can I right? There must be a way?
Most carriers do not offer an email to SMS gateway, so you don't. Use a service designed for sending SMS instead. e.g. Twilio or Amazon Simple Notification Service.

How does GitHub 'Reply by Email' work?

I notice that a lot of websites like Facebook and GitHub allow you to reply to an email notification which then posts the reply back to the application using a unique Reply-To address. How does this work on the back-end? I searched a lot but, only found that people were using unique Reply-To addresses. That's understandable but, what do they use to receive these emails? Do these companies set up email servers? I am trying to build this using PHP.
A common method is to set unique message ID's in the outgoing email and then looking at the In-Reply-To header to see which email this was in reply to. That lets you match up your server application's messaging system to emails. For example, if you send an email that represents a help desk ticket with ID 1234, the Message-ID could be something like
ticket-1234#myserver
Then, in email clients that work nicely (I'm looking at you Android), when you hit Reply, the reply has the header In-Reply-To: ticket-1234#mysever. You can go further by adding security tokens to ensure people can't forge messages (e.g. ticket-1234-hf29e9f2gf2e9fh29f#myserver). That security token is generated on the server when you send your first message and is then confirmed in the reply.
This normally works but can cause real headaches when email clients don't behave as they should!
This is how GitLab manages emails by using an identifier in the email address itself and catching it when the user replies. Although it is not relevant to any scripting language like PHP and uses server configs, this is what backend servers do to support reply by email functionality.
You have to set up a mail server to receive mail answers.
SIEVE filters on a IMAP server could be use to make some actions when a certain filter is detected.
But you can't only use PHP to make that type of system.

How to Automate SMS from PHP mysql at Particular point of Time

I have a website where people will book for Site visits.The Support Executive Confirms Site visit in the previous day. Once the Site visit is confirmed on the day on which site visit should happen the customer should receive SMS in morning telling that you have site visit today as requested.
I have Third party SMS Service
Now I Should Run a Code in PHP, MySQL which sends a SMS in the morning on which the site visit should happen
How can I Do that
Cron -> starts PHP-Script , PHP Script reads records from the SQL Table and checks if an SMS has to be sent, i assume its sms over mail, so you can use the integrated php function to send out mails to the sms gateway. For the guy confirming the visits, create another site with proper authentication where he can access the table and agree with the site-visits and anotherone for the customer to register for site visits
You need a cron job set to run in morning which will call your php file have code for looking in database for customers you need to send sms to.
Yo need to register to sum sms gateway provide 2 good one i know is clickatell and eztexting.
You can get there api for sending sms in there website.
Happy Smsing :D
Set a Cron Jobs in your Control panel.Try this link
http://www.devx.com/DevX/Article/39900/1954
If you would like to try an entirely different approach, check out:
Sent.ly - http://sent.ly
I am the founder of Sent.ly and thought maybe Sent.ly could help you out...
Sent.ly allows you to use an Android phone as an SMS gateway. So... you could just purchase a cheap Android phone ($150 or so) and set up Sent.ly on it and put a SIM in the phone.
By calling the Sent.ly API, the SMS would go out through the SIM in your Android phone. Sent.ly also has the option for scheduling an SMS for sending later which is your use case.
This also allows your PHP application to RECEIVE SMS in addition to just sending it out.
You can setup rules and if an incoming message matches a rule, it would be posted to a PHP page of your choice.
Since I am a great fan of stackoverflow, I would like to invite you to try Sent.ly. We would be happy to set you up with extra credits if you like. Just mail us at support#sent.ly
Cheers,
Varun
I have developed a system like this for use with some of my clients, and you can easily use it to integrate with your website or applications, through HTTP POST or WebServices (using PHP, C# or whatever).
If you are interested just leave an email or other contact information as a reply to this answer and I will gladly send you a sample code of how to send SMS, setting the desired time for sending messages, beyond other things, through our system.
You will not need to have any kind of cron knowledge and setup, it is all handled by our system, and the code is pretty simple and straight forward. You will only need to call our services upon site visit confirmation, setting the desired message sending time, and our system will do the rest.
Best regards.

how to receive and validate incoming mail for web based mails in php

We are developing a email web site.but we are facing problem in receiving and validating the mail.i have the following doubts.can you please help me in clarifying these???
one more important thing is we are not using squrrelmail, qmail etc.
how do we receive emails for users in email web site?
do we save all the received emails in admin's mail box or in database as per the username
(my idea on email web site is,all the incoming mail are stored in admin's mail box and after the email mail is stored in database,and then the mail deleted in admin's mail box.Is it correct.if not how to store the emails in database directly in web site)
what is the technique behind the receiving mail???i think there are various techniques like email piping etc.
is there any special process of creating users for email web site,i mean do we need to create mailbox(i think mail account) for each user at the time of registration.if we need to create mail box for user,can we create it with imap_createmailbox() function.
are the users gmail,yahoomail etc are accessig database or their mail accounts at the time their login??
can we do all these things with imap functions in php??
There are many different solutions to this problem, polling existing servers, adding scripts to run when a message is received or using a gateway like CloudMailin. I wrote a blog post relating to this (it's for rails but almost all applies to php too).
The other problems almost all span from how you setup the first thing. In many cases you could just log the emails directly to your database and retrive them based on the recipient address. I think you need to explain exactly what you want to do with the email? Are you just providing email hosting for your users or are you providing an additional service? If you're just providing hosting then there are simpler approaches available.

Web form autorespond with SMS

I have been asked to design a website for a client but one of the requirements is that there is a form which includes such things as name, email, dob and mobile number once the user submits the form a SMS is automatically sent to the users mobile almost like a autoresponder.
How to achieve this?
This can be done using an external SMS gateway which will not be free, but also not awfully expensive.
However, you say you are not a programmer. For this to be built well and most important of all, safely, it might be a good idea to use the services of one.
If you want to do it yourself, consider using a pre-paid plan with the SMS provider of your choice so you can't be ruined by a bot flooding your form with thousands of requests.
Web sms functionality can be added to any web application or website. As #Pekka said you need to use an external SMS gateway and to connect your application to this SMS Gateway. Most SMS gateways provide external API which can be used to do that. They usually have documentation which you can use to find out how to integrate SMS notification in your PHP code. Unfortunately there are no reliable free sms service provides so you have to pay for this sms service. You can check http://www.phpjabbers.com/web-sms/ which seems to work a lot easy. Their integration code is pretty simple:
<?php
$SMSLIB["phone"] = '44111222333'; // your phone number
$SMSLIB["key"] = 'abcdefghijklmnopqrs'; // your personal API code
include("smslib.php"); // we will provide you with smslib.php file
sendSMS("test message", $SMSLIB["phone"]); // function which sends the message
?>
The easiest way to do this is to send it to their mobile numbers assigned email address (which is different by each carrier) then have it sent like a normal email.
The only issue is you will probably have to have a Dropbox with each carrier then add something to the PHP that changes the email address (ex. $tmobile would be tmomail.net).
More info:
How To Send Email To Any Cell Phone (for Free)
Most of mobile carriers offer free Email To SMS gateways which can be used to forward simple text emails to a mobile phones. And the good news, majority of those gateways are free and available to the general public.

Categories