Need help with mailing a specific item with a macro


I’ve just came back for Cata in classic and i would need some help to recreate my macro which i used in WOTLK classic.

I was using this macro to mail every item to my bank character with the same item ID. I was using the macro below:

/run for bag = 0, 4 do for slot = 1, 32 do if select(10,GetContainerItemInfo(bag, slot)) == ITEM ID then PickupContainerItem(bag, slot) ClickSendMailItemButton() end end end SendMail(“BANK ALT”, “Subject”)

Could someone help me fix my macro according to th new API changes? Thank you!