Re: mail() problem
| From: | David Robley | Date: | Wed, 27 Sep 2000 01:08:48 +0000 |
| Subject: | Re: mail() problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17640@lists.php.net to get a copy of this message | ||
On Tue, 26 Sep 2000, AJDIN BRANDIC wrote:
> Hi,
> I am using mail function which sends an email to a client who then
> processes the body part. The body message should be of a specific format
> (one line with no blanck lines before or after it, and no white spaces
> before it). My message adds one (perhaps two) blank lines at the top of
> the message and I don't know why. Has anyone had a same problem before.
> The code is:
>
>
> $email = "me@here.ac.uk";
> $mailsubject = "CALL ME";
> $mailheaders = "From: us@there.com\n";
> $mailheaders .= "Cc: david@aswell.co.uk\n";
> $mailheaders .= "Bcc: \n";
> $mailheaders .= "Reply-To: someone@blah.co.uk\n";
> $mailheaders .= "X-Mailer: PHP3 Mail Function on Apache/BSD\n";
> $msg="REQUEST:$somevar:$anothervar";
>
> //Send the mail
> if (mail($email,$mailsubject,$msg,$mailheaders)) {
>
> }
> else {
> print("Error: The message could not be sent.\n");
> }
>
>
> Thanks,
>
> Ajdin
I think that this is in accordance with the standard for mail messages -
the space is required between the headers and the body of the message so
that the two can be differentiated. From RFC 822:
B.2. SEMANTICS
Headers occur before the message body and are terminated by
a null line (i.e., two contiguous CRLFs).
and
message = fields *( CRLF *text ) ; Everything after
; first null line
; is message body
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA