Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic variable question - Thanks in advance.

Status
Not open for further replies.

mstelmac

Technical User
Oct 22, 2003
53
US
Hello everyone. I am having one heck of a time doing something very simple in perl. I am trying to set a variable (named $test) to this value:
"email.address1\@yahoo.com", "email.address2\@yahoo.com"

Then I am using the variable as part of this SMTP call:
$smtp->to($test);

Here is my code but it does not:

my $test = "\"matthew.purdy\@lmco.com\", \"matthew.purdy\@lmco.com\"";
$smtp->to($test);

Can anyone un-confuse me??????

thanks,
Matt
 
If you're using the Net::SMTP module then I believe the to and recipient methods actually accept an array, not a scalar list.


Code:
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]@to[/blue] = [red]([/red][red]'[/red][purple]email.address1@yahoo.com[/purple][red]'[/red], [red]'[/red][purple]email.address2@yahoo.com[/purple][red]'[/red][red])[/red][red];[/red]
[blue]$smtp[/blue]->[maroon]to[/maroon][red]([/red][blue]@to[/blue], [red]{[/red][purple]SkipBad[/purple] => [fuchsia]1[/fuchsia][red]}[/red][red])[/red][red];[/red]

- Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top