Hi, I'm trying to create a script that send a file in attachment of a mail:
my code is something like this:
-
#set up email
-
my $to = "xxx\@xxxxxx.com";
-
my $from = "xxx\@xxxxx.com.br";
-
my $subject = "ficheiro audio ";
-
my $message = "ficheiro audio ";
-
my $path = "/home/user/Desktop/outputs/20080101_titulo-teste.mp3";
-
-
# send email
-
&email($to, $from, $subject, $message, $path);
-
-
ub email{
-
print "estou dentro de email";
-
# get incoming parameters
-
($to, $from, $subject, $message, $path) = @_;
-
-
-
# create a new message
-
$msg = MIME::Lite->new(
-
From => $from,
-
To => $to,
-
Subject => $subject,
-
Data => $message,
-
Type => 'text/plain'
-
);
-
$msg->attach(
-
Type => 'audio/x-mp3',
-
Disposition => 'attachment',
-
Path => $path);
-
-
# send the email
-
MIME::Lite->send('smtp','smtp.mail.yahoo.com.br',
-
Timeout => 60, Debug =>1,
-
AuthUser=>'tvnet_parceiros_audio', AuthPass=>'*****');
-
-
$msg->send();
-
};
-
The problem is tha I get an error in the Debug:
MIME::Lite::SMTP=GLOB(0x87c5f90)>>> MTIzNDU2
MIME::Lite::SMTP=GLOB(0x87c5f90)<<< 535 authorization failed (#5.7.0)
SMTP auth() command failed:
authorization failed (#5.7.0)
The weird thing is that if I use another account (yahoo and everything the same) but older it works perfectly.
This account I'm trying was created yesterday.
Someone knows what's happening with my smtp authorization?
thanks for any help,
Joćo