I need some help figuring out how to develop the following proposed solution:
Users should be able to send a photo via MMS message to a number - this image then needs to be picked up and processed through a web application. The application is currently written in PHP and works with manual file upload, how could I incorporate the MMS functionality into this so that it could process the users image. The application takes an image and modifies it. This is the final image that would need to be returned to the user (again via MMS)
Secondly, there also needs to be functionality for a user to email an image to an address (eg email#example.com) - the application then takes the image, processes it through the application and emails it back to the user.
Any advice or direction would be much appreicated.
For the SMS aspect of your requirements, you should check out Twilio, they are for sending and receiving SMS, thought I'm not sure how they function with MMS. Still worth looking over though.
Related
I recently ran into the problem where I found out that Apple does not allow developers to send an email directly from code without user interaction. This causes some difficulties on my app as I need a code generated email which is in HTML format to be sent from my website server to myself, a third party and the user of the app. I have a few questions regarding this:
Is it acceptable to use a PHP script to send the emails for me by calling the script from code?
Will doing it this way have my app rejected from app store as I have read that bypassing user interaction in this regard will have the app rejected?
There are tons of apps on my iOS device that send emails without me having to interact except for pressing a "submit" button or similar. How are these apps doing it?
Basically, I also need the client to just press a button and 3 emails are sent in HTML format. The client is aware of an email being sent, but I need it in HTML format without the mail client showing up. I have the same app developed on Android and if I cannot have the same flow on Apple devices it kind of breaks look from android to ios. I know this is possible as I have apps on my phone that does it. My question is, are they using PHP scripts? If so, I can do that, but I want to be sure that my app will not be rejected from App Store.
You can use the API from your webserver for this. If you have for example an API path
/mail
You can send all the relevant information in as POST paramaters (e.g. "subject" : 'test mail') and from your webserver send the email with a mail function.
This is perfectly acceptable.
You can attach this webserver call to a UIButton to make it user-interactable:
#IBAction func mailToUser(sender: UIButton) {
// POST request to /mail with relevant information
}
I am sending our HTML newsletters with an image on each email that help us know if a person actually received that newsletter.
I just add in the HTML body of the email a img tag like that:
<img src="https://www.example.com/read/BASE64URLENCODED_DATA" />
BASE64URLENCODED_DATA is something that I can read on server when the request arrives to know the email address that downloaded that image. We receive the request to download that fake image, we save the data and return some headers to show a transparent image of 1x1 px.
The problem is that usually this works for no more than the 10% of the total emails sent on each newsletter. This means that most of the email clients that receive our newsletter don't permit the downloading of images (showing the classic message "If you want to download attached images click here...").
Is there any way to force an email client to make a remote request like that?
We need to produce more realistic statistics for our newsletters but we can't find a way to force this remote requests or fake images download.
Thank you.
A longer answer - there may be ways how you can trick some e-mail clients, but this will work only on a particular client. There are lots of different clients out there. Maybe you find a way of tricking Oultook, but no guarantee that it works for Google Mail or other web mail service. Then there is Roundcube, Squirrelmail, Horde and other web clients. Then the mobile devices come in - iPhone/iPad mail client, Android mail clients, Outlook mobile.. No, you don't want to do this.
And even if you find a way of tricking all those programs (which I highly doubt), most likely your message will be malformatted and most spam filters will catch it as spam.
Hiii
how can we track the status of email sent from drupal. I want to know all the email sent from my site is delivered to client mail or not. I delivered also want to know it is read or not.
Is it posssible. if possible how can we do this...
One option is to send the email in HTML format and include a small (1px square) transparent gif, served from a PHP script on your server, with the unique id of the email appended as a GET parameter in the gif's URL. Your script can then log which emails have been opened using drupal's watchdog() function or whatever.
This is not foolproof of course, as some people's mail clients automatically refuse to download images (in order to prevent this sort of tracking by spammers) or will open HTML email in plaintext mode e.g. mobile clients. However, this could still be useful to you, depending on your situation.
The CiviCRM Drupal module provides this functionality as it's focused on political campaigning and read tracking is potentially helpful even if it's not perfect, but you'd have to use the CiviMail component to send the messages if you want to use this (it also tracks bounces, so not a bad solution).
You can't. Once it's been handed over to the mailer daemon you have no control over it any more.
There are ways of seeing if the message was received, but none of them are reliable. You can request a receipt, but the user is under no obligation to send one, and they may by annoyed by the request. You could embed a web bug (a link to an image that actually runs a script to log the fact the mail was received), but they are easily blocked and you could only use them with HTML mail anyway.
I want to add an additional functionality to a CMS I am making that will allow users to add content to a site via text message. The user should be able to upload an image and add text and send the message to a number which when received will update the database accordingly.
Can this be done, and can it be done via PHP because that's the only language I know? Also what would be the general outline to achieve such a thing?
You have to find a SMS gateway that supports "incoming" of SMS. Click-a-tell is generally the one people choose because of their API and documentation, they aren't free though. If you do a quick Google search for "SMS Gateway" you'll find plenty of other solutions.
Once you choose the gateway you want to go with, the rest of the process is easy. You would just handle the SMS as a regular request into your application.
Hope that helps you get started!
Use one of the many SMS gateways out there like Twilio (whom I work for, but loved before I was an employee) which has a really simple API and great documentation. There are tons of PHP examples. When you receive a message, a simple POST request is made to a URL you specify with parameters for To, From and Body. Also if you return text from the URLs you use to receive messages you can respond back to them. You can also initiate outbound SMS from the same number using the REST API.
Twilio does not currently support MMS (needed for your image uploading requirement) and is not free, but you only pay for what you use at $.01 per message.
Completing the answer by Raphael Caixeta, I recommend that you use the standalone PHP binary to run a pre-determined script, which parameters you'll get from the SMS/MMS. This way you can separate the two process:
1) Make a script and test it by running it through the command line.
2) Implement the SMS/MMS receiver software so that it parses the messages and runs the first script with custom parameters.
You can use a GSM/3G modem (or dongle) to receive SMS messages. And this sms software can read those messages from the modem in real time and put them automatically in your database.
I currently have a php script that reads email messages sent from phones and then it posts them on the internet...
I want to do the same thing but instead of reading emails, I would like to process the data through a SMS.
so, if someone sends a sms to X number, my program would get the message through this X number and use it in the site.
What would I need?
You have a lot of options here. Generally speaking you need to first acquire the number that people can SMS to. Afterwards a callback will be issued to you when someone sends and SMS and your PHP script can process the message and figure out what to do with it.
You essentially have a few options for exposing the SMS
Go with a dedicated short-code. Eg someone sends a text to 53234 and you will get a callback to deal with it. This is an expensive option. It will cost you generally around $2500/mo minimum not including per messaging fees. You can requisition a short code through a provider such as Open Market. You have to get approval for the short code which might take as much as 6 weeks.
Go with a shared short code. This is a bit cheaper -- you pay per message and it usually costs anywhere from .02 - .10 /msg depending on your msg volume. You get a keyword such as DOLLY that people have to preface before texting. So they would text DOLLY INPUT TEXT HERE to 53234 now and you would receive the callback with INPUT TEXT HERE. Celltrust and others provide shared short codes.
Use a public api that allows people to text in through something such as TextMarks. Textmarks is like a shared short code requires keyword usage + users to subscribe. However it is free which is great and has a nice callback API. I believe a service called Mozes also provides similar service. Finally, if you want you can set up a Twitter account and have people text to their number. Facebook also a similar API that allows you to use their FBOOK shortcode.
Ish's answer was great. I'd like to point out an additional free option.
Most carriers allow you to send SMS messages to email addresses. The SMS text gets inserted into the body of the email and the subject is carrier dependent. Once the email is sitting in your inbox, you can access it by the method of your choice.
This method has worked for me in a personal project requiring remote communication with my computer when all I had was a cell phone without internet capabilities.
This Wikipedia page shows how many carries support this (practically all).
Just try not to violate anyone's terms of service, you could always host the email account yourself.