- 论坛徽章:
- 0
|
Perl模块使用 => 简短例子代码集合!
(2)发送html内容
- #!/usr/bin/perl
- use Mail::Sender;
- open(IN, "< ./index.html") or die("");
- $sender = new Mail::Sender{
- smtp =>; 'localhost',
- from =>; 'xxx@localhost'
- };
- $sender->;Open({
- to =>; 'xxx@xxx.com',
- subject =>; 'xxx',
- msg =>; "hello!",
- ctype =>; "text/html",
- encoding =>; "7bit",
- });
- while(<IN>;)
- {
- $sender->;SendEx($_);
- }
- close IN;
- $sender->;Close();
- print $Mail::Sender::Error eq "" ? "send ok!\n" : $Mail::Sender::Error;
复制代码
发送带有图片或其他信息的html邮件,请看`perldoc Mail::Sender`
中的“Sending HTML messages with inline images”及相关部分。 |
|