# Send Mail Test

**URL:** <https://forum.kirupa.com/t/send-mail-test/268986>\
**Category:** programming\
**Created:** [August 21, 2008, 5:36am UTC](https://forum.kirupa.com/t/send-mail-test/268986 "2008-08-21T05:36:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [August 21, 2008, 5:36am UTC](https://forum.kirupa.com/t/send-mail-test/268986/1 "2008-08-21T05:36:54Z")

</div>

I wonder if a few people could test the attached files on their servers (an HTML form and processing PHP). I don’t get any meaningful error message to tell me what the issue is. Thanks for the help. The PHPcode:

```auto

<html>
<head>
<title>Multipart Mail Sent!</title>
</head>
<body>
<?php
$to = $_POST["to"];
$cc = $_POST["cc"];
$bcc = $_POST["bcc"];
$from = $_POST["from"];
$subject = $_POST["subject"];
$messagebody = $_POST["message"];
$boundary = "==MP_Bound_xyccr948x==";
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: multipart/alternative; boundary=\"$boundary\"
";
$headers .= "CC: " . $cc . "
";
$headers .= "BCC: " . $bcc . "
";
$headers .= "From: " . $from . "
";
$message = "This is a Multipart Message in MIME format
";
$message .= "--$boundary
";
$message .= "Content-type: text/html; charset=iso-8859-1
";
$message .= "Content-Transfer-Encoding: 7bit

";
$message .= $messagebody . "
";
$message .= "--$boundary
";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"
";
$message .= "Content-Transfer-Encoding: 7bit

";
$message .= $messagebody . "
";
$message .= "--$boundary--";
$mailsent = mail($to, $subject, $message, $headers);
if ($mailsent) {
  echo "Congrats! The following message has been sent: <br><br>";
  echo "<b>To:</b> $to<br>";
  echo "<b>From:</b> $from<br>";
  echo "<b>Subject:</b> $subject<br>";
  echo "<b>Message:</b><br>";
  echo $message;
} else {
  echo "There was an error...";
}
?>
</body>
</html>

```
