API GetSendMailItem

Returns information about an item attached in the send mail frame.

name, itemID, texture, count, quality = GetSendMailItem(index)

Parameters

 * index : Number - The index of the attachment to query, in the range of [1,ATTACHMENTS_MAX_SEND]

Returns

 * name : String - The localized name of the item
 * itemID : Integer - Numeric ID of the item.
 * texture : String - The icon texture for the item
 * count : Number - The number of items in the stack
 * quality : Number - The quality index of the item (0-6)

Example
The following code will loop over all the items currently attached to the send mail frame, and print information about them to the chat frame:

for i = 1, ATTACHMENTS_MAX_SEND do   local name, itemID, texture, count, quality = GetInboxItem(i) if name then -- Construct an inline texture sequence: print("You are sending", "\128T"..texture..":0\128t", name, "x", count) end end

Details

 * Requires that the mailbox window is open.
 * ATTACHMENTS_MAX_SEND is defined in Constants.lua, and currently (Jan 2014) has a value of 12. Using this variable instead of a hardcoded 12 is recommended in case Blizzard changes the maximum number of items that may be attached to a single message.
 * As of 2.3.3 this function is bugged and the quality is always returned as -1. If you need to know the item's quality, get a link for the item using, and pass the link to.