my $from = "$cfg->{mail}->{'from'}"; my $to = "$cfg->{mail}->{'to'}"; my $host = $cfg->{mail}->{smtp_host}; INFO("sending message to $to via $host"); ## My NET::SMTP invocation my $port = $cfg->{mail}->{smtp_port}; my $s = Net::SMTP->new( $host, Port => $port ); print $s->banner(), "\n"; $s->to($to); $s->mail($from); $s->data(); $s->datasend("To: $to\n"); $s->datasend("\n"); $s->datasend("$message \n" ); $s->datasend( "\n" ); $s->dataend(); $s->quit();