- $ENV{MAILADDRESS} = $opt{from};
- my $header = new Mail::Header ( [
- "From: $opt{from}",
- "To: $opt{to}",
- "Sender: $opt{from}",
- "Reply-To: $opt{from}",
- "Date: ". time2str("%a, %d %b %Y %X %z", time),
- "Subject: $opt{subject}",
- "Content-Type: $opt{mimetype}",
- ] );
- my $message = new Mail::Internet (
- 'Header' => $header,
- 'Body' => [ map "$_\n", split("\n", $opt{body}) ],
+ my $error = send_email(
+ 'from' => $opt{from},
+ 'to' => $opt{to},
+ 'subject' => $opt{subject},
+ 'content-type' => $opt{mimetype},
+ 'body' => [ map "$_\n", split("\n", $opt{body}) ],