raj8 has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that I use to send e-mail when I have added them to my ftp server, however, these individuals change daily and weekly. That said, previously I manually created an array and added the users and it worked, but now that I push users onto the array from the script, the script works but doesn't send the e-mail? I have come to a hard stop on this. Does anyone see a reason why this would not work? I have placed a snippet (not the whole script)for your thoughts. I thought--pushing users onto the array would work. As always, thank you.
my @addresses; print "Enter address(s) and press [Enter]: "; chomp($usermail= <STDIN>); print "\nE-mail Address(s) are: $usermail\n"; ## Push each user onto the array ## push(@addresses,$usermail); ### E-mail Routine ### if($usermail ne "") { $smtp = Net::SMTP->new( 'SMTPSERVERNAME' ); $smtp->mail('sender@mydomain.com'); $smtp->recipient(@addresses); $smtp->data(); #Send the header. $smtp->datasend( "To: @addresses\n" ); $smtp->datasend( "From: sender\@mydomain.com\n" ); $smtp->datasend( "Subject: FTP Access \n" ); $smtp->datasend( "\n" ); #Send the body $smtp->datasend("You have been invited to access the my projec +t FTP Site by using the following 'project name' and 'password.' \n"); my $msg = <"\nproject name is: $username\n\nPassword is: $user +passwd\n\n$MOTD">; $smtp->datasend( $msg ); $smtp->dataend(); $smtp->quit; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SMTP and Arrays
by kyle (Abbot) on Feb 25, 2008 at 18:26 UTC | |
by raj8 (Sexton) on Feb 25, 2008 at 21:12 UTC | |
|
Re: Net::SMTP and Arrays
by hesco (Deacon) on Feb 25, 2008 at 22:11 UTC | |
|
Re: Net::SMTP and Arrays
by chrism01 (Friar) on Feb 26, 2008 at 06:15 UTC | |
by raj8 (Sexton) on Mar 23, 2008 at 02:39 UTC |