2

Hi I'm building an app which I'd like to programmatically send sms through which works fine however I can't figure out how to send a subject with the sms like all the sms apps out there can.

Thank you for any help

user577732
  • 3,956
  • 11
  • 55
  • 76

2 Answers2

3

SMS do not have subject lines. I believe you would have to do MMS in order to have a subject line. Here is a working example on SO. If you are referring to some of the 3rd part SMS system, they generally have everything in a raw string and then parse it to show you how they want, but there is not subject line in a SMS.

Community
  • 1
  • 1
ObieMD5
  • 2,684
  • 1
  • 16
  • 26
  • there's a column in content://sms/ called subject though? but I don't see that column in content://mms/ – user577732 Jul 15 '13 at 22:47
  • I think you're right though although i find what i wrote above odd? – user577732 Jul 15 '13 at 22:48
  • I may be wrong, but you can send sms through email, and it is probably just a place holder for the data coming through as email to SMS. – ObieMD5 Jul 15 '13 at 22:49
  • When you add a subject line and/or picture, it becomes a MMS automatically since you are using the SmsMessage class for all three categories (SMS, MMS, EMAIL to Text). – ObieMD5 Jul 15 '13 at 22:52
0

It appears that the Sms.SUBJECT column isn't used, at least by the native SMS app. It may be a legacy column, intended to be populated from SMS-email gateways, but the comments in SmsMessageBase.extractEmailAddressFromMessageBody() make clear that this is no longer supported:

 * Try to parse this message as an email gateway message
 * There are two ways specified in TS 23.040 Section 3.8 :
 *  - SMS message "may have its TP-PID set for Internet electronic mail - MT
 * SMS format: [<from-address><space>]<message> - "Depending on the
 * nature of the gateway, the destination/origination address is either
 * derived from the content of the SMS TP-OA or TP-DA field, or the
 * TP-OA/TP-DA field contains a generic gateway address and the to/from
 * address is added at the beginning as shown above." (which is supported here)
 * - Multiple addresses separated by commas, no spaces, Subject field delimited
 * by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)

A given app can choose to populate the column itself, but the native app doesn't display its contents, and I'd bet that most others don't either.

Peter Jeffe
  • 171
  • 6