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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|