./c0de/php/massmailer.txt

0.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
code:
[ME@Machine]# cat mailer.php
<?php
$list = 'list';
$who = file($list);
$rep = array("\n" => "");
$msg = "\n
THis iS the OutGoing MEssAge
";
 
echo
"\n
E-mail List:$list
**********************
*SENDING MESSAGE
********************************
$msg
********************************\n
";
 
for($i = 0; $i <= 99999; $i++){
        if($who[$i] == ""){ $i = 99999; }else{
        echo ":\n:.\tSending to $who[$i]...\n";
        $to = strtr($who[$i], $rep);
        $headers = 'Return-Path: site.com' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type:
text/html; charset=iso-8859-1'  . "\r\n" . 'From: Robot_donotreply <[email protected]>' . "\r\n" .
        'Reply-To: Robot_donotreply <[email protected]>' . "\r\n" .
        'X-Mailer: smtpdx';
        mail($to, 'test mailer', $msg, $headers);
        }
}
echo "!Mail Sent!\n...\n";
?>
----------------------------------------------------
[ME@Machine]# php -q mailer.php
 
 
E-mail List:list
**********************
*SENDING MESSAGE
********************************
 
 
THis iS the OutGoing MEssAge
 
********************************
 
:
:.      Sending to [email protected]
...
:
:.      Sending to [email protected]
...
:
:.      Sending to [email protected]
...
:
:.      Sending to [email protected]
...
!Mail Sent!
... 

Back