Sets the amount of money to be sent with the outgoing message. Called in the default UI when clicking its Send button, immediately before sending the mail. Causes an error message if the amount plus postage exceeds the player's total money.


See also Mail functions, Money functions.

Signature:

success = SetSendMailMoney(amount)

Arguments:

  • amount - Amount of money to send (in copper) (number)

Returns:

  • success - 1 if the player has enough money to send the mail; otherwise nil (1nil)

Examples:

-- Quickly send money to a specified character (only works while at an
-- open mailbox)
function SendCharacterMoney(name, amount)
  SetSendMailMoney(amount)
  SendMail(name, number/10000 .. " gold attached", "")
end