----- Original Message -----
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
To: "Kevin Stone" <[EMAIL PROTECTED]>; "Oden Odenius"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, March 24, 2003 3:51 PM
Subject: Re: [PHP] mail() Bcc:


> > > How can send bcc: with mail()?
> > >
> > From, CC and BCC are headers to be set in the fourth parameter of the
> mail()
> > function.  Headers must be spearated by end-of-line characters.
> >
> > $headers = "From: [EMAIL PROTECTED]
> > CC: [EMAIL PROTECTED]
> > BCC: [EMAIL PROTECTED]";
> >
> > mail($to, $subject, $body, $headers);
> >
> > There are many other headers that you may find useful that are just as
> easy
> > to add through the mail() function.
>
> I don't think that'll work. The concept is right, but the way you are
typing
> it, you're actually adding in two line breaks between each header. That's
> going to cause your CC: and BCC: header to show up in the body of the
> message because anything after two consecutive line breaks is considered
the
> body.
>
> You can do it like this:
>
> $headers = "From: [EMAIL PROTECTED]: [EMAIL PROTECTED]:
> [EMAIL PROTECTED]";
>
> or
>
> $headers = "From: [EMAIL PROTECTED]
> CC: [EMAIL PROTECTED]
> BCC: [EMAIL PROTECTED]";
>
> Also, you may want to check the regs on the capitalization of the headers.
> If I'm wrong, someone please let me know, but some servers may only accept
> Bcc: instead of bcc: or BCC:, etc... ?? Does anyone know if that matters?
If
> it does, is it only dependant upon the sending SMTP server and not any
> servers the message is sent through or the receiving server?
>
> Thanks.
>
> ---John Holmes...

\r\n should be used (esspecially in email!) to be compatible with all
operating systems.  However there were mistakes in my example.  Notedly the
string I supplied would break the header with superfulous \n end-of-line
characters.  The "safe" syntax would be..

$headers = "From: [EMAIL PROTECTED]";
$headers .= "CC: [EMAIL PROTECTED]";
$headers .= "BCC: [EMAIL PROTECTED]";

In one continuous line.  I do believe headers are case insensitive.

HTH,
Kevin



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

Reply via email to