Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top