print $fh $generatedMailText or die "ERROR: Couldn't write to pipe: $! +";