English 中文(简体)
Programatically send SMS to email using Verizon Motorola Droid on Android
原标题:

I was wondering if anyone knew the proper way to send an SMS message to an e-mail address using Verizon s CDMA Motorola Droid phone.

The internal messaging application appears to automagically do this. While 3rd party applications like SMSPopup don t seem to be able to properly reply to e-mail addresses unless you compose the message inside the messaging application.

When the internal messaging application sends a SMS message there s a corresponding RIL_REQUEST_CDMA_SEND_SMS entry in the logcat (adb logcat -b radio). When you send a SMS to an e-mail address it prints the same thing, so behind the scenes it looks as though it is sending an sms. The interesting thing is that if you look at the content provider sent box the messages are addressed to various 1270XX-XXX-XXXX numbers.

On other services you can send e-mail addresses by sending a SMS to a predefined short sms number. And then formatting your SMS as emailaddress subject message i.e. http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_SMS_to_E-Mail_Gateways

For example, using T-mobile s number (500) you can send a SMS to an e-mail using the following:

SmsManager smsMgr = SmsManager.getDefault();
smsMgr.sendTextMessage("500", null, "username@domain.com message sent to an e-mail address from a SMS", null, null);

Does anyone know if

  • It is possible to programatically send SMS to email messages from a CDMA Android phone?
  • Does Verizon actually send your replies as SMS messages or are they actually sent as MMS or normal http email messages?
  • Any ideas about how to intercept what the raw message being sent to see what s going on?

It might be possible that Verizon somehow generates a fake number temporarily tied to an e-mail address (since repeated messages are not sent to the same number). But, that seems pretty heavy handed.

Thanks!

问题回答

Your wiki link helped me to find the answer. I m not totally positive on the this, but it seems 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 snippet of code:

sm.sendTextMessage("6245", null, "alienmanfc6@gmail.com (Subject) Test email from SMS", null, null);

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

    ContentValues cv = new ContentValues();
    cv.put("address", "someone@example.com");
    String time = 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





相关问题
Angle brackets in php

I want to store angle brackets in a string in PHP because i want to eventually use mail() to send an HTML email out. The following is the code that doesn t seem to work. while(...) { $msg .= "<...

authlogic auto_register feature using my options

I have auto registration working with authlogic using gaizka s version of authlogic_openid which I found on Github since pelle s original addition of the feature seemed to cause issues. http://...

Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

How to track an email in Java?

How I can track an email? I m using java on the server side for sending emails. I want to track whether it is delivered , opened, etc... How I can do that ?

Web Link in a mail is not rendering as link in yahoo

string from = "abc@gmail.com"; string to = "xyz@gmail.com,xyz@yahoo.co.in"; string password="abcxyz"; MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(to); mail.From = new ...

SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

How to create an email mailing list

Im creating a coming soon page for a website im developing, and im adding an option for the user to enter their email address so we can email them when the site is up. How do I do this?

CCNet email does not include MSBuild results

We re using CCNet 1.4.4.83 but when an MSBuild task fails, we don t get the MSBuild results (i.e. missing file or whatever reason the compile failed) in the email notification. I do see the build ...

热门标签