To send mail via WiiConnect24 and query error code strings, you utilize wiiNwc24. With mail, you can send normal messages, or gift titles. And via error codes, you can provide a better user experience.
var nwc24 = new wiiNwc24();
Returns the amount of friends on the user's friends list.
Queries information about the given friend list entry at num. For all possible type values, see Friends List.
Sends a mail using the gift design template with a body of the given message. The recipient is specified by friendIndex from the friends list. The sending user adds their Mii via miiIndex. urlPath is the URL this channel opens to when the Start button is clicked.
Please see Async Handling for more information about the workflow for handling mail errors.