SendMail

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.0.0 / 1.13.2

Sends in-game mail.

SendMail(recipient, subject [, body])

Arguments

recipient
string - Intended recipient of the mail.
subject
string - Subject of the mail. Cannot be an empty string or nil, but may be whitespace, e.g. " "
body
string? - Body of the mail.

Details

  • Triggers MAIL_SEND_SUCCESS if mail was sent to the recipient's inbox, or MAIL_FAILED otherwise. Repeated calls to SendMail() are ignored until one of these events fire.

Example

Assuming a friendly player named Bob exists on your server:

SendMail("Bob", "Hey Bob", "Hows it going, Bob?")

Patch changes

Shadowlands Patch 9.1.5 (2021-11-02): Protected when called from a (macro) script.