You should check the return value of TransferMail to see if it failed.
Here is how you would do it in Visual Basic:
...
set bundle = mailman.TransferMail()
if (bundle is Nothing) then
MsgBox mailman.LastErrorText
Exit Sub
end if
...
You may decide to handle the error differently, but the important
thing is to access the last-error information via the properties
(LastErrorText, LastErrorHtml, or LastErrorXml) or the method
SaveLastError.