Hi All,
Currently I know how to send out mail for 1 person, may I know how can i send out more than one person in the same mail and the e-mail address is grep from other file. I think should join with array function, but I have no idea how to grep every hotmail.com and join in the mail script. Here is my mail script:
sub sendpasstoemail
{
my $smtp;
my $pingStatus;
my $localcount;
my $subject = "User \'$1\' Booking Request for ATCA Chassis";
my $string = <<INFORM
Hi All,
How are you?
Thanks
Best Regard,
$username
NOTE: This is an auto-generated email, please do not reply.
INFORM
;
$pingStatus = &checkTargetPing("ORCAS01.hotmail.com");
if ($pingStatus eq 1)
{
$smtp = Net::SMTP->new('ORCAS01.hotmail.com');
$smtp->mail($3);
$smtp->to($3);
$smtp->data();
$smtp->datasend("From: Booking and Managment system\n");
$smtp->datasend("To:$3\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");
$smtp->datasend("$string\n");
$smtp->dataend();
$smtp->quit;
print $query->h2({-align=>'center'},"Your request message
+is sent to Chassis user");
}
below is my .txt file format:
#username password email address
+privilege
gordon gordon1234 gordon@hotmail.com
+ admin
danish danish1234 Danish@hotmail.com
+ user
johson johson1234 johson@hotmail.com
+ user
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.