pl = $string_utils:match_player(dobjstr);
if (!valid(pl))
player:tell("I don't understand. Try: @email <player name>.");
return;
endif
player:tell("Type in a subject.");
subject = read();
player:tell("Type in the message");
msg = $command_utils:read_lines();
player:tell("Subject: ", subject);
player:tell();
player:tell_lines(msg);
if (!$command_utils:yes_or_no("Send above message?"))
return player:tell("Nothing sent.");
endif
success = 0;
failed = {};
player:tell("Stand by sending Email.");
rc = $network:sendmail(pl.email_address, subject, msg);
if (!rc)
player:tell("Message to ", pl:title(), " was sent successfully.");
"If it returns something other than 0 (an empty string, empty list, or the number 0 are all false), the rest of this will run.";
else
player:tell(((("There was an error sending your message to " + pl:title()) + ". $network:sendmail returned") + rc) + ".");
endif