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

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

Thread Previous
From:
Ricardo Signes
Date:
May 5, 2011 06:46
Subject:
Re: do I always need to specify an encoding with Email::MIME?
Message ID:
20110505134625.GA433@cancer.codesimply.com
* James Peregrino <james_peregrino@harvard.edu> [2011-05-02T12:53:46]
> 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(

Please consider using Email::Sender instead of Email::Send.  Seriously, it's
just as easy and so much better in the long run.  Ask me more on IRC if you
like.

>         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',
>                 },
>             ),
>         ],
> 

I suggest doing so.  It won't hurt, and it can prevent various forms of
error.  I suggest using quoted-printable for the text and base64 for the
Word document.

-- 
rjbs

Thread Previous


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