I'm making a plugin that emails the site webmaster when I go to the 404 page. The script checks if the referring link is on our site, and then sends an email to the webmaster.
$message = "
<html>
<head>
<title>Alton Bible Church - Broken Link</title>
<style type=\"text/css\">
* {
font-family:Arial;
}
table {
background:#eee;
padding:15px;
}
#table {
width:500px;
overflow:scroll;
}
td {
border: 1px solid #aaa;
padding:10px;
}
</style>
</head>
<body>
<p>There's a broken link on My Website</p>
<div id=\"table\">
<table>
<tr>
<td>Broken Link</td><td>Referring Link</td>
</tr>
<tr>
<td><a href=\"" . $broken . "\">" . $broken . "</a></td><td><a href=\"" . $referrer . "\">" . $referrer . "</a></td>
</tr>
</table>
</div>
</body>
</html>";
$headers = 'MIME-Version: 1.0' . '\r\n';
$headers .= 'Content-type: text/html; charset=iso-8859-1' . '\r\n';
$headers .= 'From: My Website <no-reply@mysite.net>' . '\r\n';
mail("Webmaster <webmaster@mysite.net>", "My Website - Broken Link", $message, $headers);
The problem is, the email is not being sent. Does WordPress not allow me to use mail()?
The problem shouldn't be with the server.
Thanks!