---
schema_version: "1"
id: 9b9f3d2bcf09114bc45de0d8511ce3c654c0953df2de5fe6e43adc6aa9458dc8
title: Msg()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/sms/mc-ampscript-reference-sms-msg.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-msg.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 20b9e2703e3e7fd8a4852a2a537a2e17ecfaacb2e805efe4401528183abea8d8
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Msg()

Returns the content of a mobile-originated (MO) message. A mobile-originated message is a message sent from the mobile device of a subscriber to your SMS phone number. Compare MO messages to mobile-terminated (MT) messages, which are messages that you send to a subscriber’s mobile device.

**important:** You can only use this AMPscript function in MobileConnect. You can’t use this function in email messages, landing pages, or other content types.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
Msg(0)
```

The `Msg()` function accepts one parameter. The only accepted value for the parameter is `0`.

## Usage

This function returns the complete content of a message that was sent to you by a subscriber (an MO message).

```
%%[
  Var @incoming_message
  Set @incoming_message = Msg(0)
]%%

<p>%%=v(@incoming_message)=%%</p>
```

If an MO message contains the text “OFFER John Smith”, the example code returns the entire body of the message.

## See Also

- [Nouns](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-nouns.md)
- [Noun()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-noun.md)
- [Verb](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-verb.md)
- [MMS_Content_URL()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-mms-content-url.md)
