Email Settings for SMTP mail |
|
IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!");
fwrite($fp, $smtp_auth) or die("Couldn't write values to file!");
fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!");
fwrite($fp, $smtp_secure) or die("Couldn't write values to file!");
fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!");
fwrite($fp, $host) or die("Couldn't write values to file!");
fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!");
fwrite($fp, $port) or die("Couldn't write values to file!");
fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!");
fwrite($fp, $user);
fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!");
fwrite($fp, $pass);
fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!");
fwrite($fp, $from) or die("Couldn't write values to file!");
fwrite($fp, "\",\"pfsense ipblocklist\");\n\$mail->From = \"") or die("Couldn't write values to file!");
fwrite($fp, $from) or die("Couldn't write values to file!");
fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"IP-Blocklist encountered an event. A system log entry was made with details of event\";\n\$body .= \"
\" . date('l jS \of F Y h:i:s A') . \"
Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c ipblocklist\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"Restarting\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt\");\nob_end_clean();\n\$body .= \"
\";\n\$body .= \$results;\n\$body .= \"\";\n\$body .= \"
You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t ipblocklist |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!");
fwrite($fp, $to) or die("Couldn't write values to file!");
fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!");
fwrite($fp, $html) or die("Couldn't write values to file!");
fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - Go Back\";\n}\n?>") or die("Couldn't write values to file!");
fclose($fp);
//echo "Saved successfully!";
exec("rm email_config.html");
exec("touch email_config.html");
$file2 = "email_config.html";
$fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!");
fwrite($fp2, "
SMTP Auth | ") or die("Couldn't write values to file!"); if ($smtp_auth=="true") fwrite($fp2, "") or die("Couldn't write values to file!"); else fwrite($fp2, " | ") or die("Couldn't write values to file!"); fwrite($fp2, " |
SMTP Security | ") or die("Couldn't write values to file!"); if ($smtp_secure=="ssl") fwrite($fp2, "") or die("Couldn't write values to file!"); else fwrite($fp2, " | ") or die("Couldn't write values to file!"); fwrite($fp2, " |
Host | ||
Port | ||
Username | ||
Password | ||
Use HTML formatting | ") or die("Couldn't write values to file!"); if ($html=="true") fwrite($fp2, "") or die("Couldn't write values to file!"); else fwrite($fp2, " | ") or die("Couldn't write values to file!"); fwrite($fp2, " |
From email address | ||
To email address | ||
Subject |
=$pgtitle?>
|