---
schema_version: "1"
id: 0ac85a7e0fb1d76c841e9f669015130a0ef51366ea5286a58219b00f74dcac52
title: Send Message
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/ltng/sendMessage/ltng-send-message.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/ltng-send-message.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1397d0b12664f1e1407b368fc8a993f78d4837bae091b42af6aa5c3776f99825
products:
  - Lightning Component Reference
---
# Send Message

**`ltng:sendMessage`**

Sends some data (String or JSON) to other components within the application.

**For Use In**

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

Fire this event when you want to send a message to another component. To send a message, specify a string of text that you want to pass between components. Optionally, specify a channel for this event so that your components can select if they want to listen to particular event messages Using a channel is useful if you want to put multiple components on a page and you want to separate them into channels to prevent conflicts.

```javascript
sendMsg: function(component, event) {
 var sendMsgEvent = $A.get("e.ltng:sendMessage");
 sendMsgEvent.setParams({
          "message": "Hello World",
          "channel": "AccountsChannel"
 });
 sendMsgEvent.fire();
}
```


:::::

:::::tab
## Attributes

| Name      | Description                                                                                         | Type   | Default | Required                                     |
| --------- | --------------------------------------------------------------------------------------------------- | ------ | ------- | -------------------------------------------- |
| `channel` | Represents the channel name. Use a channel to enable a component to filter down to specific events. | string |         |                                              |
| `message` | A message in the form of a String or JSON.                                                          | string |         | ![Yes](https://developer.salesforce.com/media/check.png) |

:::::

::::::
