in reply to content-length first line

Try
print "[$subject] [$emailid]\n";
I guess you got a newline char at the end of one of them which will show up in a linebreak before the closing bracket.
If this doesn't help, try
print "open MAIL,\"|/usr/bin/mailx -s '$subject' -r 'email\@email.com' + $email +id\";\n"; print "Lines of Text go here";
to see what you're really passing to mailx. Checking your inbox on the mailserver (usually in /var/spool/mail/) may also help.

Replies are listed 'Best First'.
Re^2: content-length first line
by ikegami (Patriarch) on Sep 15, 2009 at 20:16 UTC
    If you're right (and you probably are), it's odd and unfortunate that the mailer blindly inserts the newline rather than escaping it or throwing an error. boooo!