use Encode qw/encode/; ... $smtp_agent -> subject( encode('MIME-Q', $subject ));