, script. Net:: SMTP:: TLS MIME:: Lite
use MIME::Lite;
use Net::SMTPS;
my $file="/var/www/myweb/myfile.txt";
open(FILE, $file) or die "Can't read file 'filename' [$!]\n";
$document = <FILE>;
close (FILE);
my $msg = MIME::Lite ->new (
From => 'sender@hotmail.com',
To => 'recipient@hotmail.com',
Subject => 'mail subject',
Data => qq{
<body>
Text message body HTML format. <p> $document </p>
</body>
},
Type => 'text/html; charset=UTF-8'
);
my $USERNAME = 'sender@hotmail.com';
my $PASSWORD = 'password';
my $smtps = Net::SMTPS->new("smtp.live.com", Port => 587, doSSL=> 'starttls', SSL_version=>'TLSv1');
$smtps->auth ( $USERNAME, $PASSWORD ) or DIE("Could not authenticate with mail.\n");
$smtps ->mail('sender@hotmail.com');
$smtps->to('recipient@hotmail.com');
$smtps->data();
$smtps->datasend( $msg->as_string() );
$smtps->dataend();
$smtps->quit;
Outlook.com GMail.
!