Re: Mail();
| From: | Sara Golemon | Date: | Mon, 02 Jun 2003 17:18:00 +0000 |
| Subject: | Re: Mail(); | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969354198@lists.php.net to get a copy of this message | ||
> > Bug in: http://cz.php.net/manual/en/function.mail.php
> >
> > Example 2. Sending mail with extra headers.
> >
> > mail("nobody@example.com", "the subject", $message,
> > "From: webmaster@$SERVER_NAME\r\n"
> > ."Reply-To: webmaster@$SERVER_NAME\r\n"
> > ."X-Mailer: PHP/" . phpversion());
> >
> > -----------
> > That's not correct mail header (see RFC822, STD3).
>
> Please quote the section which describes this, I can not find it in the
> RFC.
>
Section 6.1 defines SYNTAX and allows for mailbox to be defined in one of
two ways:
mailbox = addr-spec ; simple address
/ phrase route-addr ; name & addr-spec
The address format noted in the example is the first one "simple address"
which requires that the email address be specified used "addr-spec".
addr-spec is defined as:
addr-spec = local-part "@" domain ; global address
Which does *NOT* include the <> delimiters. They are only required for the
second form of mailbox "name & addr-spec" with phrase being the realname
portion defined earlier in the document a string containing a limited set of
legal charatcers, or a quoted string containing 7-bit characters (exluding
control characters). "route-addr" is then defined as:
route-addr = "<" [route] addr-spec ">"
And this is where we find addr-spec (with optional route syntax)
encapsulated in <>s.
Bottom line, the example (which contains only an addr-spec with no route or
phrase) is correct and in conformance with RFC822.
-Sara