Use MIME::Lite to send mail
- package MailTracker;
- require Exporter;
- @ISA = qw (Exporter);
- @Exporter = qw(Send);
- use MIME::Lite;
- our $Mailer;
- our $msg;
- #my %args;
- sub new{
- my $self = {};
- shift;
- my %args = (
- From => 'from@x.com',
- To => 'to@x.com',
- Cc => 'cc@x.com',
- Subject => 'PLS set subject name!!',
- Type => 'text/html',
- Encoding => 'base64',
- Data => 'No data',
- SMTPHost => 'smtpem4.x.net',
- @_,
- );
- $msg = MIME::Lite->new(
- From => $args{From},
- To => $args{To},
- Cc => $args{Cc},
- Subject => $args{Subject},
- Type => $args{Type},
- Encoding => $args{Encoding},
- Data => $args{Data}
- );
- bless ($self);
- return $self;
- }
- sub Send{
- $msg->send('smtp',"smtpem4.x.net");
- }
- 1;
阅读(918) | 评论(0) | 转发(0) |