perl mime::lite 附加文本文件换行错误
perl mime::lite attach text file line feed error
my @test = ("Row1", "Row2", "Row3");
my $attch = join("<cr><lf><br>\n", @test);
$message = MIME::Lite->new(
From => $mailFrom ,
To => $address,
Subject => $title,
Type => 'text/html',
Encoding => '8bit',
Data => $data
);
$message->attach(
Type =>'TEXT',
Data => $attch
);
MIME::Lite->send('smtp', $host, Timeout => 20);
$message->send;
美好的一天,我正在尝试通过电子邮件发送文件,但我无法写出正确的换行符,代码发送了一封带有附件的电子邮件,该附件包含以下信息:
"Row1<cr><lf><br>\nRow2<cr><lf><br>\nRow3"
如何获得:
Row1
Row2
Row3
在附件中?
$message->attach(
Type => 'TEXT',
Data => join('', map { "$_\n" } @test),
);
my @test = ("Row1", "Row2", "Row3");
my $attch = join("<cr><lf><br>\n", @test);
$message = MIME::Lite->new(
From => $mailFrom ,
To => $address,
Subject => $title,
Type => 'text/html',
Encoding => '8bit',
Data => $data
);
$message->attach(
Type =>'TEXT',
Data => $attch
);
MIME::Lite->send('smtp', $host, Timeout => 20);
$message->send;
美好的一天,我正在尝试通过电子邮件发送文件,但我无法写出正确的换行符,代码发送了一封带有附件的电子邮件,该附件包含以下信息:
"Row1<cr><lf><br>\nRow2<cr><lf><br>\nRow3"
如何获得:
Row1
Row2
Row3
在附件中?
$message->attach(
Type => 'TEXT',
Data => join('', map { "$_\n" } @test),
);