RE: [PHP] Mail Headers problem.......

2002-05-23 Thread Martin Towell

dunno if this helps, but try using "\r\n" instead of just "\n" when you
create $headers

-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mail Headers problem...


I am writing a small email logging / forwarding script and am having 
problems with the headers.  I am successfully getting the MIME-Version and 
Content-type, but when I insert them into the forwarded email message, the 
headers show within the email itself. Below is the code I am using.

$to = "$user_email[0]";
$subj = "$Subject";
$msg = "$Message";

$headers = "From: $From[1]\n";
$headers .= "$Mime_Version\n";
$headers .= "$Content_Type\n";
mail($to, $subj, $msg, $headers);

This is what the email looks like.

Return-Path: 
Received: (from mail@localhost)
by redhotsweeps.com (8.9.3/8.9.3) id VAA27003;
Thu, 23 May 2002 21:23:51 -0500
Date: Thu, 23 May 2002 21:23:51 -0500
Message-Id: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: test
From: [EMAIL PROTECTED]
Status:

Content-type: text/plain; charset="us-ascii"; format=flowed

test 1234


Can anyone give me any tips?

Thanks

CDitty




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mail Headers problem.......

2002-05-23 Thread CDitty

Actually tried that earlier.  No difference in the result.

Chris

At 10:48 PM 5/23/2002, you wrote:
>dunno if this helps, but try using "\r\n" instead of just "\n" when you
>create $headers
>
>-Original Message-
>From: CDitty [mailto:[EMAIL PROTECTED]]
>Sent: Friday, May 24, 2002 1:20 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Mail Headers problem...
>
>
>I am writing a small email logging / forwarding script and am having
>problems with the headers.  I am successfully getting the MIME-Version and
>Content-type, but when I insert them into the forwarded email message, the
>headers show within the email itself. Below is the code I am using.
>
>$to = "$user_email[0]";
>$subj = "$Subject";
>$msg = "$Message";
>
>$headers = "From: $From[1]\n";
>$headers .= "$Mime_Version\n";
>$headers .= "$Content_Type\n";
>mail($to, $subj, $msg, $headers);
>
>This is what the email looks like.
>
>Return-Path: 
>Received: (from mail@localhost)
>by redhotsweeps.com (8.9.3/8.9.3) id VAA27003;
>Thu, 23 May 2002 21:23:51 -0500
>Date: Thu, 23 May 2002 21:23:51 -0500
>Message-Id: <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: test
>From: [EMAIL PROTECTED]
>Status:
>
>Content-type: text/plain; charset="us-ascii"; format=flowed
>
>test 1234
>
>
>Can anyone give me any tips?
>
>Thanks
>
>CDitty
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-23 Thread Analysis & Solutions

On Thu, May 23, 2002 at 10:19:51PM -0500, CDitty wrote:

> $to = "$user_email[0]";
> $subj = "$Subject";
> $msg = "$Message";
> 
> $headers = "From: $From[1]\n";
> $headers .= "$Mime_Version\n";
> $headers .= "$Content_Type\n";

You're not showing us how you come up with the $From[1], $Mime_Version
and $Content_Type variables.  I'm guessing the $Mime_Version is only
getting "Status:\n" stuck into it.  Then, your $headers string adds the 
extra "\n" which results in the following output you're showing...

> Subject: test
> From: [EMAIL PROTECTED]
> Status:
> 
> Content-type: text/plain; charset="us-ascii"; format=flowed
> 
> test 1234

Later,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-24 Thread CDitty

Per your request..

Chris

// To email address
if(substr($lines[$i], 0, 2) == "To"){
 $To = substr($lines[$i], 4, strlen($lines[$i]));
 eregi("([A-Z0-9\.\-]+@[A-Z0-9\.\-]+\.[A-Z\.]+)", $To, $To);
}elseif(substr($lines[$i], 0, 4) == "From"){// From email address
 $From = substr($lines[$i], 6, strlen($lines[$i]));
 eregi("([A-Z0-9\.\-]+@[A-Z0-9\.\-]+\.[A-Z\.]+)", $From, $From);
}elseif(substr($lines[$i], 0, 7) == "Subject"){// Email subject
 $Subject = substr($lines[$i], 9, strlen($lines[$i]));
}elseif(substr($lines[$i], 0, 12) == "MIME-Version"){// Email subject
 $Mime_Version = substr($lines[$i], 14, strlen($lines[$i]));
}elseif(substr($lines[$i], 0, 12) == "Content-Type"){// Email subject
 $Content_Type = substr($lines[$i], 14, strlen($lines[$i]));
}

if(IsSet($Mime_Version)){
 $Mime_Version = "MIME-Version: $Mime_Version\r\n";
}
if(IsSet($Content_Type)){
 $Content_Type = "Content-type: $Content_Type\r\n";
}



At 11:55 PM 5/23/2002, you wrote:
>On Thu, May 23, 2002 at 10:19:51PM -0500, CDitty wrote:
>
> > $to = "$user_email[0]";
> > $subj = "$Subject";
> > $msg = "$Message";
> >
> > $headers = "From: $From[1]\n";
> > $headers .= "$Mime_Version";
> > $headers .= "$Content_Type";
>
>You're not showing us how you come up with the $From[1], $Mime_Version
>and $Content_Type variables.  I'm guessing the $Mime_Version is only
>getting "Status:\n" stuck into it.  Then, your $headers string adds the
>extra "\n" which results in the following output you're showing...
>
> > Subject: test
> > From: [EMAIL PROTECTED]
> > Status:
> >
> > Content-type: text/plain; charset="us-ascii"; format=flowed
> >
> > test 1234
>
>Later,
>
>--Dan
>
>--
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-24 Thread Analysis & Solutions

Hi:

> Per your request..

[... code snipped ...]
My request was really for you to examine your code, not to send the code
to me:


> >... I'm guessing the $Mime_Version is only
> >getting "Status:\n" stuck into it.  Then, your $headers string adds the
> >extra "\n" which results in the following output you're showing...

So, go take a look at the parts of your script where you set
$Mime_Version and everything in that is used in the creation of that 
variable.

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-24 Thread CDitty

I have looked at it and from what I understand, it should be working but 
it's not.

At 12:18 PM 5/24/2002, you wrote:
>Hi:
>
> > Per your request..
>
>[... code snipped ...]
>My request was really for you to examine your code, not to send the code
>to me:
>
>
> > >... I'm guessing the $Mime_Version is only
> > >getting "Status:\n" stuck into it.  Then, your $headers string adds the
> > >extra "\n" which results in the following output you're showing...
>
>So, go take a look at the parts of your script where you set
>$Mime_Version and everything in that is used in the creation of that
>variable.
>
>Enjoy,
>
>--Dan
>
>--
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-24 Thread Jason Wong

On Saturday 25 May 2002 01:29, CDitty wrote:
> I have looked at it and from what I understand, it should be working but
> it's not.

Try plugging in fixed strings for your headers and see what results.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
A good name lost is seldom regained.  When character is gone,
all is gone, and one of the richest jewels of life is lost forever.
-- J. Hawes
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail Headers problem.......

2002-05-24 Thread Analysis & Solutions

On Fri, May 24, 2002 at 10:58:08AM -0500, CDitty wrote:

> if(IsSet($Mime_Version)){
> $Mime_Version = "MIME-Version: $Mime_Version\r\n";
> }

Man, THINK!

Did you set $Mime_Version anywhere in your code before this point?

What happens here if $Mime_Version isn't set already?

Then, remember what I pointed out before, about $Mime_version when 
you're using it in your header variable.

Sorry to be snippy.  We're here to help, not do your work for you.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php