Programatically Send Sms To Email Using Verizon Motorola Droid On Android
Solution 1:
I came across your question because I had the same question but your wiki link help me to find the answer. Now Im not toally possitive on the this but it seams to be working when you send a regular text message to this number: 6245 and then the text message will contain the address and subject and body in this format: email@gmail.com (Subject) body of the email.
here is my snipit of code:
sm.sendTextMessage("6245", null, "alienmanfc6@gmail.com (Subject) Test email from SMS", null, null);
and yes thats my accuall email there if you want to ask me more questions, I hope this helps you and I thank you very much for posting your link that helped me :)
Solution 2:
I have been looking for a way to send short emails using the SMS delivery system, and without having to know the service center address, special destinations and message formats etc.
As Dave points out, the stock text messaging app can do this (confirmed with Motorola Droid+Verizon and Attrix+AT&T). Go SMS turns messages to an email address into an MMS. Handcent however, seems to do this just right -- the email from address is the email-to-SMS address e.g. 2223334444@vtext.com.
The approach that has worked for me is as follows. This is all highly experimental and completely undocumented.
Write directly to the SMS content provider ("content://sms") and insert the outbound message
ContentValuescv=newContentValues(); cv.put("address", "someone@example.com"); Stringtime= System.currentTimeMillis()+""; cv.put("date", time); cv.put("body", "I love stackoverflow"); cr.insert(uri, cv); // cr = ContentResolver cv.put("type", "6");
The key "discovery" is type = 6. Values 1 and 2 are for incoming and outgoing SMS (could be the other way around) and 3 is for draft messages. 6 is for messages that could not be sent (empiricaly determined by putting the phone in airplane mode and sending a text to an email address using the stock app).
All this places the message into the SMS store. To actually send it, the stock app needs to be poked into retrying. I find putting the phone into airplane mode and toggling back out works--the message is sent to email using SMS!!--but there must be a better way (and Handcent knows it?)
And oh Verizon doesn't seem to like angle brackets in its message content.
I have implemented this in an app that tries to determine the phone's email-to-SMS address by sending out an email and looking at the from address: http://bit.ly/J08Dyh
It's not been widely tested yet, so I am equally curious.
PVS
Post a Comment for "Programatically Send Sms To Email Using Verizon Motorola Droid On Android"