1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| #!/usr/bin/perl
use strict; use warnings;
use Net::SMTP::SSL;
# je suppose que ton port est bien 465 ?
my $smtps = Net::SMTP::SSL->new('smtp.mail.yahoo.fr', Port => 465);
die "$!" unless defined $smtps;
$smtps->auth('saskee', 'saskee');
$smtps->mail('saskee@yahoo.fr');
$smtps->to('saskee@yahoo.fr');
my $ok = $smtps->data(<<EOM);
To: saskee@yahoo.fr
From: saskee@yahoo.fr
Subject: test
Test ?!
EOM
if( $ok ) {
print "Message envoyé\n";
} else {
print "Problème... $!";
}
$smtps->quit; |
Partager