# Newline format. send message to each email listed
my $output = join "\n", split " ", $receipts;
I don't think "Newline format" is a valid way to make a list of email recipients for MIME::Lite. I've always used comma separated lists and all the examples I've seen are like that. Perhaps you could consider making a small test program that just sends a test email to two addresses. After you get that working then make small test programs for the other parts of this you need to accomplish.