Hello,
I am using a script that takes a html page from the internet, that adds the absolute URL and that finally
sends the parsed html to a mail recipient.
Each time I run it on win32, it makes Apache restart!
I've tried it on the remote server (Unix) and mails
are distributed as required.
The problem is that I don't know if the script makes Apache restart on the unix server.
Does anyone have any idea? Is there a way I can notice if the server has restarted because a script error?
Anyway, here is the code below:
// FROM URL SECTION
$url = "$domain = "$to_use = fopen($url, "r"
$html = "";
while (!feof($to_use)) {
$html .= fgets($to_use, 2000);
}
$html = str_replace("src=\"", "src=\"" . $domain, $html);
$html = str_replace("SRC=\"", "SRC=\"" . $domain, $html);
$html = str_replace("background=\"", "background=\"" . $domain, $html);
$html = str_replace("href=\"", "href=\"" . $domain, $html);
//echo($html);
// CREATE HEADER SECTION
$headers = "From: me@domain.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEMO"
$headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This is the plain text version!");
$headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode($html));
// SEND MAIL SECTION
mail("me@domain.com", $url, "", $headers);
My Work...
...and More...
I am using a script that takes a html page from the internet, that adds the absolute URL and that finally
sends the parsed html to a mail recipient.
Each time I run it on win32, it makes Apache restart!
I've tried it on the remote server (Unix) and mails
are distributed as required.
The problem is that I don't know if the script makes Apache restart on the unix server.
Does anyone have any idea? Is there a way I can notice if the server has restarted because a script error?
Anyway, here is the code below:
// FROM URL SECTION
$url = "$domain = "$to_use = fopen($url, "r"
$html = "";
while (!feof($to_use)) {
$html .= fgets($to_use, 2000);
}
$html = str_replace("src=\"", "src=\"" . $domain, $html);
$html = str_replace("SRC=\"", "SRC=\"" . $domain, $html);
$html = str_replace("background=\"", "background=\"" . $domain, $html);
$html = str_replace("href=\"", "href=\"" . $domain, $html);
//echo($html);
// CREATE HEADER SECTION
$headers = "From: me@domain.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEMO"
$headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This is the plain text version!");
$headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode($html));
// SEND MAIL SECTION
mail("me@domain.com", $url, "", $headers);
My Work...
...and More...