my @addresses; print "Enter address(s) and press [Enter]: "; chomp($usermail= ); 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 project FTP Site by using the following 'project name' and 'password.' \n"); my $msg = <"\nproject name is: $username\n\nPassword is: $userpasswd\n\n$MOTD">; $smtp->datasend( $msg ); $smtp->dataend(); $smtp->quit; };