in reply to Problem in adress field for email script.
Creates a string that is literallyqq("nafroz\@sunamerica.com","sdas\@sunamerica.com")
"nafroz\@sunamerica.com","sdas\@sunamerica.com"
Whereas
is passing a list of two values, neither of which contain quotes, to the to() method. You can make the following changes ('#-' means remove the line it quotes, and replace it with the code following):$smtp->to("nafroz\@sunamerica.com" , "sdas\@sunamerica.com");
#- my $recepient = qq("nafroz\@sunamerica.com","sdas\@sunamerica.com") +; my @recepient = ("nafroz\@sunamerica.com","sdas\@sunamerica.com"); #- $smtp->to($recepient); $smtp->to(@recepient);
What I have done here is replace your scalar with an array that has your two addresses as members, then alter your call to to() so that it takes that list as the argument.
|
|---|