In reply to cgales:
For your mailbox problem, I’d guess you had also forgotten to create mail1 and it was null (that’s what “bad handle or reference” means).
For your second problem, you’re not allowed to drive nets (interface elements of type wire) from procedural code (in your case a task). You can only drive nets from continuous assign statements. Declaring them as logic messed up your top level module because you were expecting wires there (it seems like you’re trying to connect these signals to an inout port of the DUT. Whether these signals are supposed to be wires or logics, I cannot say, since I don’t know your full setup (though it seems you want wires as the DUT’s ports are bidirectional). To read up on the topic of connecting TB and DUT together, I’d suggest this paper from Dave Rich.
P.S. I wouldn’t hijack a thread like this with further questions that aren’t related to the thread name, but rather create a new one for each question. Remember, you’re not just asking for yourself, but for other people who might have the same problem in the future.