$smtp = Net::SMTP->new('smtp.host.com'); $smtp->mail('someone@example.com'); $smtp->to('someone@example.com'); my $ret = $smtp->data($maildata);