you cant just simply add the cart display code to the page, you need concatenate it to the existing message string. there are some parts of the cart display that are PHP code, and part of the display.
for example:
if (!$enersolmaCart->IsEmpty())
{
so those parts should not be concatenated.
you should terminate the string before the if statement, then continue concatinging the rest of the message.:
$strMessage = '<font face="tahoma,arial" size=2>'."Hola\n\n" .$_POST["companyname"]. "<br>alguien ha hecho un pedido:<p>Nombre:\n\n".$_POST["nombre"]."<br>Apellidos:\n\n".$_POST["apellidos"]."<br>Direccion:\n\n".$_POST["tipo_via"].$_POST["nombre_via"]."<br>Ciudad:\n\n".$_POST["poblacion"]."<br>C.P.:\n\n".$_POST["cp"]."<br>Provincia:\n\n".$_POST["provincia"]."<br>Telefono:\n\n".$_POST["telefono"]."<br>Movil:\n\n".$_POST["movil"]."<br>Email:\n\n".$_POST["email"]."<br>Importe Total:\n\n".$totalemail."';
if (!$enersolmaCart->IsEmpty())
{
$strMessage .= '<table width="100%" style=" border-right:solid 1px #CAD0CD; /* Neutral_Medium */ border-left:solid 1px #CAD0CD; /* Neutral_Medium */ border-bottom:solid 1px #CAD0CD; /* Neutral_Medium */ margin-bottom:14px;" border="0" cellspacing="0" cellpadding="0">
<tr>...';