i try to send the looped echo output via mail like below.
Do i have to transfer the output into an array first?
<?php
$jsonData = file_get_contents("https://test.com");
$data = json_decode($jsonData,true);
foreach ($data["results"] as $value) {
if($value["fuel"]=="Elektro"){
echo ($value[product_stock_total]);
echo "*";
}}
?>
<?php
$to = "test@me.com";
$subject = "This is a test HTML email";
$message = "
<html>
<head>
<title>$total</title>
</head>
<body>
<p>Gesamt: $total</p>
<p>MINI: $totalmini</p>
</body>
</html>
";
mail($to,$subject,$message,$headers);
?>
Thanks in advance :)