Forum Clubic

Pb envoi de mail en perl smtp la poste

Bonjour,
j’ai un probleme avec l’envoi d’un mail en perl:

use strict;
use Net::SMTP;

my $message = “From: vu-du-ciel@laposte.net\nTo:mathurin_61@hotmail.fr\nSubject: Hello World\n\nTest\n\n”;
print “Message:\n”;
print $message;
print “\n”;

my $DEBUG = 1;

my $ServerName = “smtp.laposte.net”;
my $ServerAccount = "vu-du-ciel@laposte.net";
my $ServerPwd = “******”;
my $MailFrom = "vu-du-ciel@laposte.net";
my $MailTo = "mathurin_61@hotmail.fr";

print “Server variables assigned\n”;

my $smtp = Net::SMTP->new($ServerName, Hello => “ooooooooooooo”, Debug => 1);
die “Couldn’t connect to server” unless $smtp;
print “Server connection opened\n”;

if ( !$smtp->auth($ServerAccount, $ServerPwd) ) {
print “authentication failed or not needed\n”;
}

if ( !$smtp->mail( $MailFrom ) ) {
print “sender not accepted\n”;
exit 1;
}

if (!$smtp->to( $MailTo ) ) {
print “addressee not accepted\n”;
exit 1;
}

print “Server variables checked\n”;

my $maildata = $message;
$smtp->data();
$smtp->datasend( $maildata );
$smtp->dataend();
$smtp->quit();
$smtp->quit;

print “Finished sending email\n”;

l’erreur est la suivante : 535 Error: authentication failed

Vire le "@laposte.net" du serveur account ?

ok je vais tester merci