Sendmail virker fint i php4 men ikke i php5
HejJeg har fundet dette script som virker fint hos surftown med php4, nu har de opdateret til php5 og scriptet virker ikke mere.
Er der ikke en venlig sjæl som kan rette det til?
<?php
ini_set('display_errors',1);
ini_set('error_reporting',E_ALL);
$strname=ucfirst($_REQUEST["strname"]);
$straddress=ucfirst($_REQUEST["straddress"]);
$strcity=ucfirst($_REQUEST["strcity"]);
$strstate=ucfirst($_REQUEST["strstate"]);
$strkontakt=ucfirst($_REQUEST["strkontakt"]);
$strservice=ucfirst($_REQUEST["strservice"]);
$strservice2=ucfirst($_REQUEST["strservice2"]);
$strhvad=ucfirst($_REQUEST["strhvad"]);
$strhvad2=ucfirst($_REQUEST["strhvad2"]);
$phone=$_REQUEST["strno"];
if($phone != ""){ $strno=$phone; } else { $strno="-"; }
$stremail=$_REQUEST["stremail"];
$strcomments=ucfirst($_REQUEST["strcomments"]);
$filename=$_FILES["strresume"]["name"];
$filetype=$_FILES["strresume"]["type"];
$filesize=$_FILES["strresume"]["size"];
$filetemp=$_FILES["strresume"]["tmp_name"];
if($filetype=="application/octet-stream" or $filetype=="text/plain" or $filetype=="image/jpeg" or $filetype=="")
{
$message= '
<table cellspacing="0" cellpadding="8" border="0" width="400">
<tr>
<td colspan="2"></td>
</tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Navn</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strname.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Adresse</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$straddress.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>By</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strcity.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Postnr</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strstate.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Telefon</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strno.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Email</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$stremail.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Besked</strong></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strcomments.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Kontakt</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strkontakt.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Service</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strservice.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Andet</strong></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strservice2.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
<tr bgcolor="#eeeeee">
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Hvad drejer det sig om</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strhvad.'</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Andet</strong></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strhvad2.'</td>
</tr>
<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
</table>
';
// MAIL SUBJECT
$subject = "Mailformular";
// TO MAIL ADDRESS
$to="my@email.dk";
/*
// MAIL HEADERS
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: Webformular <my@email.dk>\n";
*/
//SKAL OPTIMERES TIL PHP 5 - SURFTOWN
// MAIL HEADERS with attachment
$fp = fopen($strresume, "rb");
$file = fread($fp, $strresume_size);
$file = chunk_split(base64_encode($file));
$num = md5(time(300));
//normal headers
$headers = "From: Name<my@email.dk>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=".$num."\n";
$headers .= "--$num\n";
// This two steps to help avoid spam
// $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">\n";
// $headers .= "X-Mailer: PHP v".phpversion()."\n";
// With message
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "".$message."\n";
$headers .= "--".$num."\n";
// Attachment headers
$headers .= "Content-Type:".$strresume_type." ";
$headers .= "name=\"".$strresume_name."\"\n";
$headers .= "Content-Transfer-Encoding: base64\n";
$headers .= "Content-Disposition: attachment; ";
$headers .= "filename=\"".$strresume_name."\"\n\n";
$headers .= "".$file."\n";
$headers .= "--".$num."--";
// SEND MAIL
mail ($to, $subject, $message, $headers);
/*
fclose($fp);
echo "<script>window.location.href='http://www.my_website.dk/Tak.html';</script>";
// echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Attachment has been sent Successfully.<br /></font>';
*/
}
else
{
echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Dit foto er i forkert format, der kan kun sendes jpg filer.</font>';
//echo "<script>window.location.href='careers.html';</script>";
}
?>