Hans Kaspersetz wrote:
So my guess is that the address the mail is coming from doesn't exist or the headers are malformed. Send us the complete headers for on of your generated emails.

It should look like:

Subject: foo bar
From: blah blah <[EMAIL PROTECTED]>
Date: Mon, 14 Jan 2008 19:09:03 -0600
To: "Blah blah" <[EMAIL PROTECTED]>
Return-path: <[EMAIL PROTECTED]>
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Mon, 14 Jan 2008 20:09:01 -0500
Received: from [189.149.170.20] (helo=[192.168.0.198]) by host.cxdhosting.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from <[EMAIL PROTECTED]>) id 1JEaIR-0006mC-1b for [EMAIL PROTECTED]; Mon, 14 Jan 2008 20:08:55 -0500
Message-ID: <[EMAIL PROTECTED]>
User-Agent:
Thunderbird 2.0.0.9 (Windows/20071031)


That will start to help us pin point what the problem is.

Hans

Thanks, Hans. Here are the headers:

Return-path: <[EMAIL PROTECTED]>
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Mon, 14 Jan 2008 19:49:12 -0600
Received: from nobody by hosting.company.com with local (Exim 4.68)
        (envelope-from <[EMAIL PROTECTED]>)
        id 1JEavQ-0007T3-9u; Mon, 14 Jan 2008 19:49:12 -0600
To: [EMAIL PROTECTED]
Subject: Newsletter Request
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Date: Mon, 14 Jan 2008 19:49:12 -0600

Hmmm, I wonder why "Envelope-to:" is the same as "Cc:" in the headers? Anyway, here's my code for creating the headers & sending the mail:

/* code to initialize other variables, validate & filter incoming data, etc. */

// initialize variables
$to = '[EMAIL PROTECTED]';
$subject = 'Newsletter Request';

// build message
$message = "\nName: $name\n\n";
$message .= "E-mail: $email\n\n";
$message .= "Received from IP: $ip on $timestamp\n\n";
$message .= "-----------------\n\n";
$message .= "This e-mail was automatically generated by your form processing script. The submitted data was also written to a CSV file on your server.\n";

// build additional headers
$additionalHeaders = "From: [EMAIL PROTECTED]";
$additionalHeaders .= "To: [EMAIL PROTECTED]";
$additionalHeaders .= "Cc: [EMAIL PROTECTED]";
$additionalHeaders .= "Return-Path: -f [EMAIL PROTECTED]";
$additionalHeaders .= "Reply-To: [EMAIL PROTECTED]";

if (!isset($error)) {
    $mailSent = mail($to, $subject, $message, $additionalHeaders);
   /* code to write to csv file */
}

/* a few more lines of code to handle errors & close script */

Regards,
Bev

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to