Click to See Complete Forum and Search --> : Random 6 digit number
Extreme
12-02-2003, 09:14 PM
I wish to have random 6 digits subject in my PHP mailer every time he send another message, but don't know how to implement it... This is a mass mailer btw. This is the topic about the mailer I am talking about. Maybe that helps your answer.
TOPIC (http://forums.webdeveloper.com/showthread.php?s=&postid=117522#post117522)
One more thing. Is there such PHP mailer that support proxys? If there is, can someone post some code, or tell how to implement it into mine from the URL I posted?
<?PHP
$rand = "";
for ($i=0; $i<6; $i++) {
$rand .= rand(0,9);
}
echo $rand;
?>
Extreme
12-02-2003, 10:43 PM
EVerything is working properly.. Thank you...
Look for this part:
function sendmail($location,$subject,$messagebody,$xheaders
){
list($to,$firstname,$lastname) = explode('*',$location);
$messagebody = str_replace('{firstname}',$firstname,$messagebody);
$messagebody = str_replace('{lastname}',$lastname,$messagebody);
mail("$to" , "ID: $subject" ,$messagebody,$xheaders);
}
and try replacing it with:
function sendmail($location,$subject,$messagebody,$xheaders) {
$rand = "";
for ($i=0; $i<6; $i++) {
$rand .= rand(0,9);
}
list($to,$firstname,$lastname) = explode('*',$location);
$messagebody = str_replace('{firstname}',$firstname,$messagebody);
$messagebody = str_replace('{lastname}',$lastname,$messagebody);
mail($to.$rand, "ID: $subject", $messagebody, $xheaders);
}
Extreme
12-02-2003, 11:10 PM
I just needed to replace all $subject variables with $rand variable, and I missed one, so that is why it didn't work..
It works now, but there is an error. After the script has been executed, all emails are sent but with the same Random subject.. If I refresh the script, all emails will be sent again with different random subject from the first time, but it will be the same for all emails that were sent in this execution.
I need different subject ID for every email that is sent.. CAn this be done?
Extreme
12-03-2003, 12:01 AM
Also, while we are at this mailer... Can you tell me how to read message body and emails list from my computer, and use them in this mailer script that is on the server? I mean HTML form script.. I guess I should delete few lines in my mailer then?!?? The URL to mailer is same(above), so i wouldn't waste space by posting it here too..
I deleted
$options_mail_body_file = 'testing.html';
line from mailer.PHP, and putted this into my HTML from:
<input type="file" name="options_mail_body_file">
...but I get this error:
Warning: file_get_contents(C:\\Documents and Settings\\COMPART\\Desktop\\testing.html): failed to open stream: No such file or directory in /home/1234143ocm/public_html/scripts/massmailer2.php on line 32