i have a quick cut and dry email subroutine for a "module" that i define in the top then just "call" it when i wish to send myself email.... i.e.;
sendemail($server,$bounchaddess,$@to,$@from,$sender,$recipient,$subject,$body)
... have you tried to create a "subroutine module" for these kinds of calls?