# Outbound external messages (https://docs-kyrm16yq7-ton-core-docs.vercel.app/llms/foundations/messages/external-out/content.md)



Outbound external messages are the messages that a contract can send to the outer world. They are primarily used for logging purposes. They can't change any contract state or trigger a transaction. These messages are visible to anyone, and there is no guarantee that anyone outside the blockchain will process them.

The structure is as follows:

```tlb
ext_out_msg_info$11
    src:MsgAddressInt
    dest:MsgAddressExt
    created_lt:uint64
    created_at:uint32
= CommonMsgInfo;

message$_
    {X:Type}
    info:CommonMsgInfo
    init:(Maybe (Either StateInit ^StateInit))
    body:(Either X ^X)
= Message X;
```

Unlike [incoming](/llms/foundations/messages/external-in/content.md) external messages, a third party can't manipulate the contents of outgoing external messages, so there is no need to sign them.

* `src` — an [internal address](/llms/foundations/addresses/overview/content.md) of the contract that sends the message. It has to be a valid address, but is not important, as it will be overwritten by the address of sender after the message is sent.
* `dest` — any valid [external address](/llms/foundations/addresses/overview/content.md).
* `created_at` — arbitrary value, overwritten with the `created_at` field of the transaction in which the contract sent this message.
* `created_lt` — arbitrary value, overwritten with the `created_lt` field of the transaction, incremented by one.

When sending this kind of message, the contract may fill all of these fields with any values. `src`, `created_lt`, and `created_at` will be overwritten by the validator processing this message.

For an outbound external message, `init` field also can store arbitrary data, as outbound external messages can't initialize any contract.

## Message modes [#message-modes]

As outbound external messages do not carry any Toncoin value, the price of their handling is paid similarly to [`SEND_MODE_PAY_FEES_SEPARATELY`](/llms/foundations/messages/modes/content.md) mode. However, using any mode other than [`SEND_MODE_IGNORE_ERRORS`](/llms/foundations/messages/modes/content.md), [`SEND_MODE_BOUNCE_ON_ACTION_FAIL`](/llms/foundations/messages/modes/content.md), or [`SEND_MODE_PAY_FEES_SEPARATELY`](/llms/foundations/messages/modes/content.md) for outbound external messages results in [exit code `34`](/llms/tvm/exit-codes/content.md). In this case, regardless of whether the [`SEND_MODE_IGNORE_ERRORS`](/llms/foundations/messages/modes/content.md) mode was used, the action phase will fail. Mode [`SEND_MODE_PAY_FEES_SEPARATELY`](/llms/foundations/messages/modes/content.md) does not change the message behavior.

## Example in Tolk [#example-in-tolk]

In Tolk, outbound external messages may be composed using the `createExternalLogMessage` function.

```tolk title="Tolk"
tolk 1.2

struct(0x10) ValueWasDeposited {
    value: int64
}

fun main(in: InMessage) {
    val msg = createExternalLogMessage({
        dest: createAddressNone(),
        body: ValueWasDeposited {
            value: 1000,
        },
    });
    msg.send(SEND_MODE_PAY_FEES_SEPARATELY);
}
```
