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; };
In reply to Net::SMTP and Arrays by raj8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |