If you need to send Internet mail, you should use Net::SMTP. For more information on Net::SMTP, see How do I send email from ActivePerl?.
# Sender’s Name and Password # my $sender = “YOUR NAME HERE”; my $passwd = “YOUR PASSWORD HERE”; # Create a new MAPI Session # use Win32::OLE; $session = Win32::OLE->new(“MAPI.Session”) or die “Could not create a new MAPI Session: $!”; # Attempt to log on. # my $err = $session->Logon($sender, $passwd); if ($err) { die “Logon failed: $!”; } # Add a new message to the Outbox. # $msg = $session->Outbox->Messages->Add(); # Add the recipient. # $rcpt = $msg->Recipients->Add(); $rcpt->{Name} = “RECIPIENT NAME HERE”; $rcpt->Resolve(); # Create a subject and a body. # $msg->{Subject} = “Test Message”; $msg->{Text} = <
Related Questions
- If you need to send Internet mail, you should use Net::SMTP. For more information on Net::SMTP, see How do I send email from ActivePerl?.
- Can I use the Internet Toolkit to send email programmatically with Simple Mail Transport Protocol (SMTP)?
- Can NT send/recieve mail directly with the Internet or other SMTP hosts?