bogu wrote:You are right, this is very sad ... 🙁
Keep drinking your beer and don't bother me by your silly replies 😉
I solved my problem by example of one guy from another forum...
/* now we will create a MIME e-mail using $html_body and $text_body */
/* First the HTML body */
$html_body = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
</head>
<style type="text/css" media="screen">
table
{
border-collapse:collapse;
border: 3pt ridge black;
background-color:#05a2e5;
width=600px;
}
td
{
font-family: "Arial", "Helvetica ", ;
color:black ;
Font-Size : 14px;
vertical-align:center;
background-color:#fff99d;
border: 1px solid black; padding:8px;
}
h1 {text-align:center; vertical-align:center; Font-Size : 22px; background-color=#05a2e5; color:yellow;}
p {font-family: "Arial", "Helvetica ", ; color:black ; Font-Size : 14px;
text-align:left; vertical-align:center; background-color:"#05a2e5"}
</style>
<style type="text/css" media="print">
table
{
border-collapse:collapse;
border: 3pt ridge black;
background:#05a2e5;
color:blue;
}
td
{
font-family: "Arial", "Helvetica ", ;
color:blue ;
Font-Size : 10pt;
vertical-align:center;
background-color:#fff99d;
border: 1px solid black; padding:3px;
}
h1 {text-align:center; vertical-align:center; Font-Size : 20pt; background-color=#05a2e5; color:yellow;}
p {font-family: "Arial", "Helvetica ", ; color:blue ; Font-Size : 10pt;
text-align:left; vertical-align:center; background:#05a2e5}
</style>
<body>
<!-- Main table start -->
<table>
<tr><td colspan=2; style="background-color:#05a2e5;">
<h1>Contact Form<br /></h1>
<br />
<p>
Thank you very much indeed for your enquiry; it is very much appreciated. Would you
please check the details below and advise us if you need to modify anything.
</p>
<p>We will endeavour to reply as soon as possible. Please call 0000000000 if you require an immediate response.
</p>
<p>
Kind regards.
<br />
<br />
xxxxxxxxxxxxxxxx
<br />
<br />
</p>
</td></tr>
<tr>
<td>Date and time form completed</td>
<td>' . date('d.m.Y') . ' - ' . date('G:i:s') . '</td></tr>';
$html_body .= "<tr><td>Name</td><td>" . $_POST['salutation'] . ' ' .$_POST['name'] . "</td></tr>";
$html_body .= "<tr><td>Telephone Number</td><td>" . $_POST['telephone'] . "</td></tr>";
$html_body .= "<tr><td>email address</td><td>" . $_POST['email'] . "</td></tr>";
$html_body .= "<tr><td>How we heard about</td><td>" . $_POST['referred_by'] . "</td></tr>";
$html_body .= "<tr><td>Notes</td><td>" . $_POST['notes'] . "</td></tr>";
$html_body .= "<tr><td>" . $_SERVER['REMOTE_ADDR'] . "</td><td>" . $_SERVER['HTTP_REFERER'] . "</td></tr>";
/* Now the plain text body */
$text_body = "Thank you very much indeed for your enquiry; it is very much appreciated. Would you please check the details below and advise us if you need to modify anything.\n\n";
$text_body .= "We will endeavour to reply as soon as possible. Please call 0000000000 if you require an immediate response.\n\n";
$text_body .= "Kind regards.\n\nxxxxxxxxxx\n\n\n";
$text_body .= 'Date ' . date('d.m.Y') . ' - Time ' . date('G:i:s') . "\n\n";
$text_body .= "Name --------------- " . $_POST['salutation'] . ' ' .$_POST['name'] . "\n\n";
$text_body.= "Telephone Number---- " . $_POST['telephone'] . "\n\n";
$text_body.= "email address------- " . $_POST['email'] . "\n\n";
$text_body.= "How we heard about - " . $_POST['referred_by'] . "\n\n";
$text_body.= "Notes -------------- " . $_POST['notes'] . "\n\n";
$text_body.= $_SERVER['REMOTE_ADDR'] . '- Referrer ' . $_SERVER['HTTP_REFERER'];
/* now create the MIME e-mail */
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/related;\n" .
" boundary=\"{$mime_boundary}\"";
$message=NULL;
$message .=
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$text_body . "\n\n";
// html part of message
$message .=
"--{$mime_boundary}\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$html_body . "\n\n";
$message .= "--{$mime_boundary}--\n";
$subject = 'Website Contact Form - ' . $_POST['salutation'] . ' ' .$_POST['name'];
$from = $_POST['email'];
$to = 'sales@xxxxxxxx.co.uk';
mail($to,$subject,$message,"From:$from".$headers);
$from = 'sales@xxxxxxxx.co.uk';
$to = $_POST['email'];
mail($to,$subject,$message,"From:$from".$headers);