chandru210486 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I use Net::SMTP to send mail from my perl program. when i receive the mail, i am not able to see the recipient's address. I want to see the recipient's address in the mail. please let me know how i can do that. Below is my code. perl version used v5.8.8.
sub send_mail { my ($rpt_name) = @_; (my $volume, my $directories, my $file_name) = File::Spec->spl +itpath($rpt_name); my $from = "abc\@a.com"; my $to = "aa\@aa.com, bb\@bbbb.com"; my @EMAIL_RECIPIENTS = split(/[,;]/, $to); my $DATA1; $smtp = Net::SMTP->new($host , Debug => 1); $smtp->mail($from); foreach $recipient (@EMAIL_RECIPIENTS) { $smtp->to($recipient); } open(DATA1, $rpt_name) || die("Could not open the file"); my @csv = <DATA1>; close(DATA1); $smtp->recipient($to, { SkipBad => 1 }); $smtp->data(); $smtp->datasend("Subject: TEST MAIL \n\n @csv"); $smtp->dataend(); $smtp->quit; } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to print the recipients address in my mail
by tobyink (Canon) on Oct 19, 2012 at 23:03 UTC | |
by chandru210486 (Initiate) on Oct 22, 2012 at 22:26 UTC | |
|
Re: How to print the recipients address in my mail
by Old_Gray_Bear (Bishop) on Oct 19, 2012 at 22:49 UTC |