Jump to content

Having trouble with form sending blank email


Hades666

Recommended Posts

Hi there, I apologise if this post is not within forum protocol but I am desperate and in need of help!!

I have a contact form that emails the details direct to me and for some reason it has started emailing a blank email now. The only difference is that the server is now running PHP 5.1.4.... I THINK, and bear in mind I am a bit rubbish at all this, that I have got it down to the following code that could be causing the problem. Can anyone help?

[code]function mail_it($content, $subject, $email, $recipient) {
  global $attachment_chunk, $attachment_name, $attachment_type, $attachment_sent, $bcc;

  $ob = "----=_OuterBoundary_000";
  $ib = "----=_InnerBoundery_001";
 
  $headers  = "MIME-Version: 1.0\r\n";
  $headers .= "From: ".$email."\n";
  $headers .= "To: ".$recipient."\n";
  $headers .= "Reply-To: ".$email."\n";
  if ($bcc) $headers .= "Bcc: ".$bcc."\n";
  $headers .= "X-Priority: 1\n";
  $headers .= "X-Mailer: DT Formmail".VERSION."\n";
  $headers .= "Content-Type: multipart/mixed;\n\tboundary=\"".$ob."\"\n";
 
         
  $message  = "This is a multi-part message in MIME format.\n";
  $message .= "\n--".$ob."\n";
  $message .= "Content-Type: multipart/alternative;\n\tboundary=\"".$ib."\"\n\n";
  $message .= "\n--".$ib."\n";
  $message .= "Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n";
  $message .= "Content-Transfer-Encoding: quoted-printable\n\n";
  $message .= $content."\n\n";
  $message .= "\n--".$ib."--\n";
  if ($attachment_name && !$attachment_sent) {
      $message .= "\n--".$ob."\n";
      $message .= "Content-Type: $attachment_type;\n\tname=\"".$attachment_name."\"\n";
      $message .= "Content-Transfer-Encoding: base64\n";
      $message .= "Content-Disposition: attachment;\n\tfilename=\"".$attachment_name."\"\n\n";
      $message .= $attachment_chunk;
      $message .= "\n\n";
      $attachment_sent = 1;
  }
  $message .= "\n--".$ob."--\n";
 
  mail($recipient, $subject, $message, $headers);
}[/code]

And

[code]// prepare the content
$content = parse_form($HTTP_POST_VARS, $sort);[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.