how to automatically send email with attachments in Perl?# Unix - 噫吁兮,危乎高哉
s*n
1 楼
大家好,
最近在写一个程序,可以自动生成信件,然后发给客户。在UNIX下我用PERL调用sendmail,
可以发送文本信息,但却不知如何发送附件。在网上搜了一通,很多人
问过这个问题,有人说至少有两种途径:1)use Net::SMTP module 2) use UNIX
sendmail directly. 很多人讲第二种很可行,但没有提供源码。
somebody posted the following to do the job, but after I test it, it didn't
work well, some unreadable text was APPENDED to the email, not attached.
Who can help me?
#!/usr/bin/perl
# Set Variables
$mailprog = "/usr/lib/sendmail";
$youremail = "r*****[email protected]"; # Your Email Address
$yourname = "Rickyao"; # Your
最近在写一个程序,可以自动生成信件,然后发给客户。在UNIX下我用PERL调用sendmail,
可以发送文本信息,但却不知如何发送附件。在网上搜了一通,很多人
问过这个问题,有人说至少有两种途径:1)use Net::SMTP module 2) use UNIX
sendmail directly. 很多人讲第二种很可行,但没有提供源码。
somebody posted the following to do the job, but after I test it, it didn't
work well, some unreadable text was APPENDED to the email, not attached.
Who can help me?
#!/usr/bin/perl
# Set Variables
$mailprog = "/usr/lib/sendmail";
$youremail = "r*****[email protected]"; # Your Email Address
$yourname = "Rickyao"; # Your