| 1 | collector | 1.1 | #!/usr/bin/perl | 
| 2 |  |  |  | 
| 3 |  |  | use strict; | 
| 4 |  |  | use warnings; | 
| 5 |  |  |  | 
| 6 | root | 1.2 |  | 
| 7 | collector | 1.1 | use MIME::Lite; | 
| 8 |  |  |  | 
| 9 | root | 1.2 | use lib qw( /data/libs/nfo/perl/libs ); | 
| 10 |  |  | use org::netfrag::shortcuts qw( now ); | 
| 11 |  |  |  | 
| 12 | root | 1.3 | my $now = now(); | 
| 13 |  |  |  | 
| 14 |  |  | #my $to      = 'joko@netfrag.org'; | 
| 15 | root | 1.4 | my $to      = 'hello@netfrag.org'; | 
| 16 |  |  |  | 
| 17 | root | 1.3 | my $subject = | 
| 18 |  |  | "This is just a test mail. Please ignore it." . "\n" . | 
| 19 |  |  | "-- generated $now" . "\n"; | 
| 20 | collector | 1.1 | my $data    = "$subject"; | 
| 21 |  |  |  | 
| 22 |  |  | my $msg = MIME::Lite->new( | 
| 23 | root | 1.2 | #  From    => 'test@localhost', | 
| 24 | root | 1.3 | #  From    => 'test', | 
| 25 |  |  | From    => 'test@netfrag.org', | 
| 26 | collector | 1.1 | To      => "$to", | 
| 27 |  |  | Subject => "$subject", | 
| 28 |  |  | Data    => "$data\n", | 
| 29 |  |  | ); | 
| 30 |  |  | my $str = $msg->as_string; | 
| 31 |  |  |  | 
| 32 |  |  | print $str; | 
| 33 | root | 1.2 |  | 
| 34 |  |  | 1; | 
| 35 |  |  |  |