naseer6679
asked on
How to send email to multiple address in perl script?
Hi,
I have a perl script and I use following syntax to send mail
print STDERR " email xyz\@xyz.com\n" ;
in the script. Please let me know syntax to specify multiple email address for sending mails to more than one email address.
Thanks in advance.
Regards,
Naseer.
I have a perl script and I use following syntax to send mail
print STDERR " email xyz\@xyz.com\n" ;
in the script. Please let me know syntax to specify multiple email address for sending mails to more than one email address.
Thanks in advance.
Regards,
Naseer.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Ozo,
Thanks for the reply I have to modify the processv1.1 script for the following code
$func = <stdin>;
our $mail = Net::SMTP->new ('IP ADDRESS');
our $out;
my $send_email = 0;
my $attach = 0;
my $subject;
my $priority;
my $bgcolor;
my $server;
my $module;
my $val;
my $thresh;
if ($func =~ /email (.*)/) {
$send_email = 1;
$subject = "Mail from Servers";
$attach = 1;
push @RECIP, $1;
while (<STDIN>) {
$out .= $_;
}
but the thing is I am not good with perl scripting and I dont know how to do looping for sending mails to multiple address. If you can suggest me that would be great.This whole process script is not made by me.
Thanks.
Naseer.
Thanks for the reply I have to modify the processv1.1 script for the following code
$func = <stdin>;
our $mail = Net::SMTP->new ('IP ADDRESS');
our $out;
my $send_email = 0;
my $attach = 0;
my $subject;
my $priority;
my $bgcolor;
my $server;
my $module;
my $val;
my $thresh;
if ($func =~ /email (.*)/) {
$send_email = 1;
$subject = "Mail from Servers";
$attach = 1;
push @RECIP, $1;
while (<STDIN>) {
$out .= $_;
}
but the thing is I am not good with perl scripting and I dont know how to do looping for sending mails to multiple address. If you can suggest me that would be great.This whole process script is not made by me.
Thanks.
Naseer.
ASKER
Thanks for the comment.
I have one centralised server with processv1.1 file which is responsible for sending mails.genmd5 script is a perl script which is responsible for the generation of the checksum data.This part of code is in print STDERR " email xyz\@xyz.com\n" ; genmd5 file. The checksum file is a shell script with calls the genmd5 script and sends mail to the centralised server having processv1.1 running on it to by opening a socket on specific port.
Please check the script and let me know how I can send mail by running genmd5 script to multiple email address.
Regards,
Naseer
checksum.txt
genmd5.txt.txt
Processv1.1.txt