Pourquoi la pièce jointe (environ 110 Ko) est-elle divisée en 10 parties (environ 11 Ko) lorsque je l'envoie avec ce script en utilisant Email::MIME?Pourquoi Email :: MIME scinde ma pièce jointe?
#!/usr/bin/env perl
use warnings; use strict;
use Email::Sender::Transport::SMTP::TLS;
my $mailer = Email::Sender::Transport::SMTP::TLS->new(
host => 'smtp.my.host',
port => 587,
username => 'username',
password => 'password',
);
use Email::MIME::Creator;
use IO::All;
my @parts = (
Email::MIME->create(
attributes => {
content_type => 'text/plain',
disposition => 'inline',
encoding => 'quoted-printable',
charset => 'UTF-8',
},
body => "Hello there!\n\nHow are you?",
),
Email::MIME->create(
attributes => {
filename => "test.jpg",
content_type => "image/jpeg",
disposition => 'attachment',
encoding => "base64",
name => "test.jpg",
},
body => io("test.jpg")->all,
),
);
my $email = Email::MIME->create(
header => [ From => '[email protected]', To => '[email protected]', Subject => 'subject', ],
parts => [ @parts ],
);
eval {
$mailer->send($email, {
from => '[email protected]',
to => [ '[email protected]' ],
});
};
die "Error sending email: [email protected]" if [email protected];
Merci beaucoup pour cela. – Kungi