develooper Front page | perl.pep | Postings from May 2011

do I always need to specify an encoding with Email::MIME?

Thread Next
From:
James Peregrino
Date:
May 2, 2011 09:53
Subject:
do I always need to specify an encoding with Email::MIME?
Message ID:
29E21FDE-8581-473E-A830-673C9A0F2A95@harvard.edu
Hi,

I'm trying to use Email::MIME to send a simple email with a .doc file as an attachment.  I receive it fine with Gmail, but my job email chokes on it when it tries to scan the attachment for viruses ('UNSCANABLE').

    send SMTP => Email::MIME->create(
        header => [
            To      => $FROMADDR,
            From    => $OWNER_EMAIL,
            Subject => "Your exam file",
        ],
        parts => [
            Email::MIME->create(
                body => "The exam file is attached to this message.",
            ),
            Email::MIME->create(
                body       => io("$EXAM"),
                attributes => {
                    filename     => $EXAM_FILE_NAME,
                    content_type => 'application/msword',
                },
            ),
        ],
    );


Should I include an 'encoding' attribute for both parts, and if so, what should it be?  Would that make it more friendly to different MTAs?

-James (mako132)

--
-- James Peregrino - http://people.dce.harvard.edu/~peregrin/business-card.html





Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About