Check out http://www.perlmonks.org/?node_id=609130
It has some proposed alternatives and links to other applicable information. You probably going to have to tailor sending mail based on the system you are on or type of email server.
You may even need to prompt users for some information first depending on what your ultimate goal is.