in reply to Re^2: Email Formatting
in thread Email Formatting

When you're working under use strict; (which is a good thing), you need to let Perl know when you're starting the use of a new variable, by declaring it with my or our, or using use vars. In your case, the problem is actually more subtle, as you're using <<EOF which tells Perl that what follows is to be a string until it sees EOF on a line by itself.

You'll also need to move the format call to whatever is sending the message to the sendmail. (as it works on filehandles... see the documentation on write ... I apologize, as I probably should have explained it better -- (if we compare 'write' to 'printf', there's no function equivalent to a 'write' version of 'sprintf' that I know of))

However, I'm more surprised that you said that lining up the text in the code didn't result in them being lined up in the e-mail. It's possible that the sendmail() function that you're using may be corrupting something, or not sending the message as plain text. If so, no matter how much work you do to get it looking pretty as plain text, something else is mangling it.