我已经使用此脚本发送文本文件,电子邮件带有附件,但是当我打开附件时它是空白的。知道为什么吗?我错过了什么吗?谢谢
#!/usr/bin/perl -wl
my $msg = MIME::Lite->new(
From => 'xxx.net',
To => 'xxx.com',
Subject => 'Report',
Type => 'multipart/mixed',
)or die "Error creating multipart container: $!\n";
$msg->attach(
Type => 'TEXT',
Data => " Please check the attached file.",
)or die "Error adding the text message part: $!\n";
$msg->attach (
Type => 'text/plain',
Path => '/myfile/file1',
Filename => 'result.txt',
Disposition => 'attachment'
)or die "Error adding the attached file part: $!\n" ;
$msg->send;