Handling Mail Errors

When an error occurs, call the MailError function to obtain the error information. You can also call MailErrorMsg to obtain a more descriptive error condition.