黑莓收邮件时,html正文的图片可能显示在附件中
my $msg=MIME::Lite->new(
To=>$to,
Cc=>$cc,
Encoding =>'base64',
Type=>'multipart/related', #如果html正文内嵌图片用related 否则可以用mixed
Subject=>"$subject",
Date=>"$DD",
);
$msg->attach(Type=>'text/html',
Data=>qq{
Here's
myimage:
#不一定是真实图片文件名,但必须跟Id的名字一致,才能关联到一起
},
);
$msg->attach(
Type=>'image/png',
Path=>$o,
Id=>'myimage.png',
);
my $str=$msg->as_string() or die "$!";
$smtp->datasend($str);
$smtp->dataend();
$smtp->quit;
认证部分用net::snmp
my $smtp = Net::SMTP->new(
Host => $host,
Hello => $host,
Timeout => 30,
Debug => 1
);
$smtp->auth(substr($auth, 0, index($auth, )), $password);
$smtp->mail($auth);
$smtp->to($_);
$smtp->cc($_);
$smtp->bcc($_);
$smtp->to($to);
$smtp->data();
$smtp->datasend("From:$namefrom \n");
阅读(2217) | 评论(0) | 转发(0) |