Also I know there is some key that will just queue an email to sendmail and return to Perl right away. So that if someone's mail server is slow user does not have to wait until sendmail finishes sending the email and return 'ok' status to perl. Which key is it?
This is straight from Perl cookbook:
The flags we give to sendmail say to not exit when a line with only a dot is read (-oi), to read the headers of the message to decide whom to send it to (-t), and to insert the message into the queue instead of attempting to deliver it immediately (-odq). This last option is only important when you're sending a lot of mail - omitting it would quickly swamp the machine with sendmail processes. If you want immediate delivery of your message (for instance, you're testing your program or the mail is urgent) remove -odq from the command line.
This really queues the message. I sent 2 test messages at the same time at 18:00. First one arrived at 22:00, the second one at 2:00. If anyone wants to use it - be careful.