hi,
I'm new in perl's world.Could anyone help me on the follwing script.
The probleme : I'm unable to send email when i pass more than 1 argument to the "to()" method
Here is the script
use strict;
use Net::SMTP;
my $smtp=Net::SMTP->new('my mailserver',Debug=>2) my $message=" this is a test ";
my $from="fred\@test.net";
my $nom="toto,tata \n";
my $email="user1\@yahoo.com,user2\@yahoo.com";
$smtp->mail($from);
$smtp->to($email);
$smtp->recipient($email);
$smtp->data();
$smtp->datasend("To: $nom \n "
$smtp->datasend("\nCc: foo \n "
$smtp->datasend("\nSubject: test smtp \n"
$smtp->datasend("\n"
$smtp->datasend($message);
$smtp->dataend();
$smtp->quit();
I get the folwong error message :
RCPT TO : <user1@yahoo.com,user2@yahoo.com>
501 Syntax error, parameters in command "RCPT TO....." unrecognized or missing.
If I put these to adress directly in the to() function it works fine .like to('user1@yahoo.com','user2@yahoo.com').
Thanks in advance for your help
I'm new in perl's world.Could anyone help me on the follwing script.
The probleme : I'm unable to send email when i pass more than 1 argument to the "to()" method
Here is the script
use strict;
use Net::SMTP;
my $smtp=Net::SMTP->new('my mailserver',Debug=>2) my $message=" this is a test ";
my $from="fred\@test.net";
my $nom="toto,tata \n";
my $email="user1\@yahoo.com,user2\@yahoo.com";
$smtp->mail($from);
$smtp->to($email);
$smtp->recipient($email);
$smtp->data();
$smtp->datasend("To: $nom \n "
$smtp->datasend("\nCc: foo \n "
$smtp->datasend("\nSubject: test smtp \n"
$smtp->datasend("\n"
$smtp->datasend($message);
$smtp->dataend();
$smtp->quit();
I get the folwong error message :
RCPT TO : <user1@yahoo.com,user2@yahoo.com>
501 Syntax error, parameters in command "RCPT TO....." unrecognized or missing.
If I put these to adress directly in the to() function it works fine .like to('user1@yahoo.com','user2@yahoo.com').
Thanks in advance for your help