Temporary-Failure Posted April 17, 2015 Share Posted April 17, 2015 if ($_POST['send'] == 'Lähetä') { if ($_SESSION['tarjouskori']) { // Estetään tuplasähköpostit. $message = "Lähettäjä: $_POST[billto_first_name]\n<br>"; $message.= "Puhelin: $_POST[billto_phone_number]\n<br>"; $message.= "Sähköposti: $_POST[billto_email]\n<br>"; $message.= "Lisätoiveet: $_POST[special_requests]\n\n<br>"; $message.= "Tuotteet\n<br><br>"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers = "Content-type: text/html; charset=iso-8859-1;" . "\r\n"; echo "<html><head><title></title></head><body>"; foreach ($_SESSION['tarjouskori'] as $product) { $message.= $product[product_code] . ' | ' . $product[product_name] . ' | ' . "<a href=\"http://www.mydomain.fi/" . "product_details.php?p=". $product[product_id] . "\">" . "Linkki</a><br>\n"; } $message.= "\n"; echo "</body></html>"; $receiver = "$config[cs_setting_shop_email]"; $topic = "-Tarjouspyyntö- " . substr($_POST[billto_email], 0, strpos($_POST[billto_email], '@', 2)); $headers.= "From: $_POST[billto_first_name] <$_POST[billto_email]>\r\n"; if (!$config['demo_mode']) @mail ($receiver, $topic, $message, $headers); unset($_SESSION['tarjouskori']); } $thanks = true; } I need to format email to html. But I cannot figure out what is wrong with this. When I test this with name: FirstName LastName I get email where first row is: From: FirstName "LastName" Lähettäjä: FirstName LastName. I don't need that from there. If I take code $headers.= "From: $_POST[billto_first_name] <$_POST[billto_email]>\r\n"; away, then that from line goes away. But how I can get senders name and email address. Topic works but sender is empty. Link to comment https://forums.phpfreaks.com/topic/295643-email-with-html-tags/ Share on other sites More sharing options...
Tom10 Posted April 17, 2015 Share Posted April 17, 2015 if ($_SESSION['tarjouskori']) { // Estetään tuplasähköpostit. $message = "Lähettäjä: ".$_POST[billto_first_name]."\n<br>"; $message.= "Puhelin: ".$_POST[billto_phone_number]."\n<br>"; $message.= "Sähköposti: ".$_POST[billto_email]."\n<br>"; $message.= "Lisätoiveet: ".$_POST[special_requests]."\n\n<br>"; $message.= "Tuotteet\n<br><br>"; ".$_POST['billto_first_name']." Link to comment https://forums.phpfreaks.com/topic/295643-email-with-html-tags/#findComment-1509267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.