我按照Email::Sender和Email::MIME中的示例进行操作,看起来不错,直到您尝试打开 PDF。然后很明显它的大小比原来的要小并且不知何故损坏了。我的脚本或多或少是出于测试目的而给出的示例的模板副本,但我担心 MIME 内容在这里不起作用。
use strict;
use warnings;
use Data::Dumper;
use IO::All ;
use Email::Simple;
use Email::Simple::Creator;
use Email::MIME;
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::SMTP;
# assemble the parts
my @parts = (
Email::MIME->create(
attributes => {
filename => "report.pdf",
content_type => "application/pdf",
encoding => "quoted-printable",
name => "report.pdf",
},
body => io("report.pdf")->all
),
Email::MIME->create(
attributes => {
content_type => "text/plain",
disposition => "attachment",
charset => "US-ASCII",
},
body => "Hello there!",
),
);
# assemble parts into …Run Code Online (Sandbox Code Playgroud) 我是一名PHP程序员,刚刚被分配任务来处理一些Perls的东西 - 我需要安装模块.
但有人可以在安装模块时向我澄清'lib'和'site\lib'之间的区别.一个模块安装在一个模块而不是另一个模块中的标准是什么?
这在Windows上是否真的相关(对不起在UNIX上工作过).
我正在使用Strawberry Perl 5.12.2.0.