I have a simple SMS Activity that replies to a SMS message that was sent to the phone. Some SMS messages have the originating address as an email address. How do you compose a r
You can examine the originating address, and if it contains an @ (for instance) send an email to the recipient with the reply message.
By this i mean you can launch the email client of the phone with the predefined message. Is that your intention?
If it serves your purpose you can try this:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "email text");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
sendIntent.setType("message/rfc822");
startActivity(Intent.createChooser(sendIntent, "Title:"));
So the solution to this seemed to be this:
Each cell carrier has a specific SMS number that you can send a text message to in a certain format. This is called a "SMS Gateway". (Similarly, there are gateways to send SMS messages from Email addresses.)
Example:
AT&T - Send a test message to "121" or "111" and format the message like this:
"address text" -or- "address (subject) text"
If you do that and your carrier is AT&T then that SMS address will then send an email to the email address in the body of the text message.
The problem with this is that you must know the SMS Gateway number & format in for your carrier in order for this to work.
I hope someone else finds this helpfull.
P.S. I have Virgin Mobile and it turns out that since Virgin Mobile uses the Sprint network, I was able to use the Sprint SMS Gateway to send SMS messages to email addresses.