in reply to Problem in adress field for email script.

<update>I see GrandFather was faster and more concise than me</update>
qq("nafroz\@sunamerica.com","sdas\@sunamerica.com")
Creates a string that is literally
"nafroz\@sunamerica.com","sdas\@sunamerica.com"

Whereas

$smtp->to("nafroz\@sunamerica.com" , "sdas\@sunamerica.com");
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):
#- 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.

Larry Wall is Yoda: there is no try{}
The Code that can be seen is not the true Code