suddently the mail() function stopped working at my web hotel. The mail doesn't get sent. Theres not any errors or anything. I just can't receive the e-mail
Code: Select all
<?php
include("config.php");
session_start();
$to = "webshop@diett-kost.no";
$subject = "Webshop Bestilling";
$headers = "webshop@diett-kost.no";
//Cart
$cart = "";
foreach( $HTTP_SESSION_VARSї'items'] as $key=>$value )
{
$link = mysql_connect( $hostname, $username, $password );
mysql_select_db( $db )
or die ( "Couldn't open $db: ".mysql_error() );
$result = mysql_query( "SELECT * FROM products WHERE prodnr='".$key."'" );
$row = mysql_fetch_assoc($result);
$cartloop = '
<table width="100%" height="20" border="0" cellpadding="1" cellspacing="0">
<tr>
<td width="20%" valign="top">'.$rowї"prodnr"].'</td>
<td width="40%" valign="top">'.$rowї"product"].'</td>
<td width="20%" valign="top">'.$rowї"price"].',-'.'</td>
<td width="20%" valign="top">'.$value.'</td>
</tr></table>';
mysql_close( $link );
$cart = $cart.$cartloop;
}
//The mail
$body = '
Fornavn: '.$_POSTї'firstname'].'
<br>
Etternavn: '.$_POSTї'lastname'].'
<br>
<br>
Adresse: '.$_POSTї'adress'].'
<br>
Postnummer: '.$_POSTї'postnumber'].'
<br>
Sted: '.$_POSTї'place'].'
<br>
<br>
Telefon: '.$_POSTї'phonenumber'].'
<br>
E-mail: '.$_POSTї'email'].'
<br>
<br>
Kommentar: '.$_POSTї'comment'].'
<br>
<br>
<b>Bestilling:</b><br><br>
<table width="100%" height="20" border="0" cellpadding="1" cellspacing="0" bgcolor="#f1f1f1">
<tr>
<td width="20%">Prodnr</td>
<td width="40%">Produkt</td>
<td width="20%">Pris</td>
<td width="20%">Antall</td>'."$cart";
mail($to,$subject,$body,"Content-type: text/html; charset=iso-8859-1\r\n");
session_destroy();
header( "Location: index.php" );
?>