Picks up an item from or puts an item into an attachment slot for sending mail. If the cursor is empty and the mail attachment slot contains an item, that item is put onto the cursor. If the cursor contains an item and the slot is empty, the item is placed into the slot. If both the cursor and the slot contain items, the contents of the cursor and the mail attachment slot are exchanged.

Only has effect if the player is interacting with a mailbox (i.e. between the MAIL_SHOW and MAIL_CLOSED events). Causes an error message (UI_ERROR_MESSAGE) if an invalid mail attachment slot is specified or if the item on the cursor cannot be mailed (e.g. if the item is soulbound).


See also Mail functions, Cursor functions.

Signature:

ClickSendMailItemButton(index, autoReturn)

Arguments:

  • index - Index of a mail attachment slot (between 1 and ATTACHMENTS_MAX_SEND) (number)
  • autoReturn - True to automatically return the item in the given attachment slot to the player's bags; false or omitted to put the item on the cursor (boolean)

Examples:

-- Places the first item in your backpack in the auction house item slot
PickupContainerItem(0, 1)
ClickSendMailItemButton()