sonicos
Legacy Member
Hey,
Als contact pagina wordt ingevuld krig ik mail met gegevens waarbij
de output niet overal HTML weergeeft, maar de HTML-tags.
Mail ziet er zo uit
Content-type: text/html; charset=iso-8859-1
<b>Naam: </b><BR />victorio, geen lid<BR /><BR /><b>Adres: </b><BR />steenweg<BR /><BR /><b>Email: </b><BR />[email protected]<BR /><BR /><b>Telefoon: </b><BR /><BR /><BR /><b>heeft een vraag voor </b>jan<BR /><b>over: </b><BR />testen<BR /><BR /><b>Bericht: </b><BR
/>test<BR />
script
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
if ($action == "send")
{
include("config.php");
$to = $ademail;
$from = $_POST['from'];
$name = $_POST['fullname'];
$tel = $_POST['tel'];
$onderwerp = $_POST['onderwerp'];
$message = $_POST['message'];
$bestemming = $_POST['bestemming'];
$lid = $_POST['lid'];
$adres = $_POST['adres'];
$to = trim($to);
$from = trim($from);
$name = trim($name);
$tel = trim($tel);
$subject = trim($subject);
$message = trim($message);
if (empty($to))
{
$ermessage = "Error: Email address to can not be blank, Please enter your email address in the config file!";
include("_files/email_error.html"); exit();
}
if (empty($from))
{
$ermessage = "Foutje! Gelieve uw emailadres in te vullen zodat wij u kunnen contacteren.";
include("_files/email_error.html"); exit();
}
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $from))
{
$ermessage = "Foutje: Ongeldig emailadres, vul het a.u.b. opnieuw in!";
include ("_files/email_error.html"); exit;
}
if (empty($name))
{
$ermessage = "Foutje! U vergat uw naam in te vullen.";
include("_files/email_error.html"); exit();
}
if (empty($lid))
{
$ermessage = "Gelieve aan te duiden of u lid bent";
include("_files/email_error.html"); exit();
}
if (empty($bestemming))
{
$ermessage = "Gelieve aan te duiden voor wie of welke dienst dit bericht bestemd is.";
include("_files/email_error.html"); exit();
}
if (empty($onderwerp))
{
$ermessage = "Foutje! Gelieve het onderwerp in te vullen.";
include("_files/email_error.html"); exit();
}
if (empty($message))
{
$ermessage = "Berichtvak is leeg! Gelieve uw boodschap neer te schrijven...";
include("_files/email_error.html"); exit();
}
$headers = "From: ".$name." <".$from.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subject = "Vraag voor " . $bestemming . " vanop de website.";
$message = "<b>Naam: </b>" . "<BR />" . $fullname . ", " . $lid . " lid" . "<BR />" . "<BR />" . "<b>Adres: </b>" . "<BR />" . $adres . "<BR />" . "<BR />" . "<b>Email: </b>" . "<BR />" . $from . "<BR />" . "<BR />" . "<b>Telefoon: </b>" . "<BR />" . $tel . "<BR />" . "<BR />" . "<b>heeft een vraag voor </b>" . $bestemming . "<BR />" . "<b>over: </b>". "<BR />" . $onderwerp . "<BR />" . "<BR />" . "<b>Bericht: </b>" . "<BR />" . $message . "<BR />" ;
$send = mail($to, $subject, $message, $headers);
if ($send)
{
include("_files/email_sent.html"); exit();
}
else
{
$ermessage = "Er is blijkbaar iets mis gegaan en uw boodschap is niet verzonden. Gelieve opnieuw te proberen.";
include("_files/email_error.html"); exit();
}
}
else
{
include("_files/email.html");
}
?>
Alvast Bedankt !
Als contact pagina wordt ingevuld krig ik mail met gegevens waarbij
de output niet overal HTML weergeeft, maar de HTML-tags.
Mail ziet er zo uit
Content-type: text/html; charset=iso-8859-1
<b>Naam: </b><BR />victorio, geen lid<BR /><BR /><b>Adres: </b><BR />steenweg<BR /><BR /><b>Email: </b><BR />[email protected]<BR /><BR /><b>Telefoon: </b><BR /><BR /><BR /><b>heeft een vraag voor </b>jan<BR /><b>over: </b><BR />testen<BR /><BR /><b>Bericht: </b><BR
/>test<BR />
script
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
if ($action == "send")
{
include("config.php");
$to = $ademail;
$from = $_POST['from'];
$name = $_POST['fullname'];
$tel = $_POST['tel'];
$onderwerp = $_POST['onderwerp'];
$message = $_POST['message'];
$bestemming = $_POST['bestemming'];
$lid = $_POST['lid'];
$adres = $_POST['adres'];
$to = trim($to);
$from = trim($from);
$name = trim($name);
$tel = trim($tel);
$subject = trim($subject);
$message = trim($message);
if (empty($to))
{
$ermessage = "Error: Email address to can not be blank, Please enter your email address in the config file!";
include("_files/email_error.html"); exit();
}
if (empty($from))
{
$ermessage = "Foutje! Gelieve uw emailadres in te vullen zodat wij u kunnen contacteren.";
include("_files/email_error.html"); exit();
}
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $from))
{
$ermessage = "Foutje: Ongeldig emailadres, vul het a.u.b. opnieuw in!";
include ("_files/email_error.html"); exit;
}
if (empty($name))
{
$ermessage = "Foutje! U vergat uw naam in te vullen.";
include("_files/email_error.html"); exit();
}
if (empty($lid))
{
$ermessage = "Gelieve aan te duiden of u lid bent";
include("_files/email_error.html"); exit();
}
if (empty($bestemming))
{
$ermessage = "Gelieve aan te duiden voor wie of welke dienst dit bericht bestemd is.";
include("_files/email_error.html"); exit();
}
if (empty($onderwerp))
{
$ermessage = "Foutje! Gelieve het onderwerp in te vullen.";
include("_files/email_error.html"); exit();
}
if (empty($message))
{
$ermessage = "Berichtvak is leeg! Gelieve uw boodschap neer te schrijven...";
include("_files/email_error.html"); exit();
}
$headers = "From: ".$name." <".$from.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subject = "Vraag voor " . $bestemming . " vanop de website.";
$message = "<b>Naam: </b>" . "<BR />" . $fullname . ", " . $lid . " lid" . "<BR />" . "<BR />" . "<b>Adres: </b>" . "<BR />" . $adres . "<BR />" . "<BR />" . "<b>Email: </b>" . "<BR />" . $from . "<BR />" . "<BR />" . "<b>Telefoon: </b>" . "<BR />" . $tel . "<BR />" . "<BR />" . "<b>heeft een vraag voor </b>" . $bestemming . "<BR />" . "<b>over: </b>". "<BR />" . $onderwerp . "<BR />" . "<BR />" . "<b>Bericht: </b>" . "<BR />" . $message . "<BR />" ;
$send = mail($to, $subject, $message, $headers);
if ($send)
{
include("_files/email_sent.html"); exit();
}
else
{
$ermessage = "Er is blijkbaar iets mis gegaan en uw boodschap is niet verzonden. Gelieve opnieuw te proberen.";
include("_files/email_error.html"); exit();
}
}
else
{
include("_files/email.html");
}
?>
Alvast Bedankt !
