Closed yctest9296 closed 6 years ago
I found solution:
Email::Sender
should be used along with MIME::Entity
if attachment is needed. Module writer mentioned it in description page of MIME::Lite
(https://metacpan.org/pod/MIME::Lite).
Below code tests ok:
my $top = MIME::Entity->build(
Type => "multipart/mixed",
To => '***',
# cc => '***',
From => '***',
Subject => "***",
);
my $attach_file="./1.txt";
if($attach_file){
$top->attach(
Type => "text/plain",
Path=>$attach_file,
Disposition => "attachment",
);
}
$top->attach(#need to be put in last part
Type => "text/html",
Data=>$html_body,
);
sendmail($top, { transport => $transport });
Hi, Could you tell me how to use this module to send mail with attachment? Is it possible to be used like the format of MIME::Lite (as below)? Many thanks~