Of course, I'd change the open to use the three argument form, add a little error checking, and neaten it up a little bit. Also this is just typed into a web browser, never tested, so don't be alarmed if it cures world hunger or causes the outbreak of WWIII. Just sayin'.

If I paste print MAIL $attachment; next to mailx open (MAIL, "|mailx -s "$subject\" -r $from $mailing_list"); then body content is getting missed. If we paste before closing MAIL file handler then we are able to get both body message as well as attachment in mail.