aidan Thu Apr 28 08:57:54 2005 EDT
Modified files: /phpdoc/en/reference/mail/functions mail.xml Log: Add a little more info about sendmail_from http://cvs.php.net/diff.php/phpdoc/en/reference/mail/functions/mail.xml?r1=1.31&r2=1.32&ty=u Index: phpdoc/en/reference/mail/functions/mail.xml diff -u phpdoc/en/reference/mail/functions/mail.xml:1.31 phpdoc/en/reference/mail/functions/mail.xml:1.32 --- phpdoc/en/reference/mail/functions/mail.xml:1.31 Sun Feb 13 22:37:34 2005 +++ phpdoc/en/reference/mail/functions/mail.xml Thu Apr 28 08:57:53 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.31 $ --> +<!-- $Revision: 1.32 $ --> <refentry id="function.mail"> <refnamediv> <refname>mail</refname> @@ -92,16 +92,29 @@ <para> This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). - <note> - <para> - If messages are not received, try using a LF (\n) only. - Some poor quality Unix mail transfer agents replace LF by CRLF - automatically (which leads to doubling CR if CRLF is used). - This should be a last resort, as it does not comply with - <ulink url="&url.rfc;2822">RFC 2822</ulink>. - </para> - </note> </para> + <note> + <para> + When sending mail, the mail <emphasis>must</emphasis> contain + a <literal>From<literal> header. This can be set with the + <parameter>additional_headers</parameter> parameter, or a default + can be set in &php.ini;. + </para> + <para> + Failing to do this will result in an error + message similar to <literal>Warning: mail(): "sendmail_from" not + set in php.ini or custom "From:" header missing</literal>. + </para> + </note> + <note> + <para> + If messages are not received, try using a LF (\n) only. + Some poor quality Unix mail transfer agents replace LF by CRLF + automatically (which leads to doubling CR if CRLF is used). + This should be a last resort, as it does not comply with + <ulink url="&url.rfc;2822">RFC 2822</ulink>. + </para> + </note> </listitem> </varlistentry> <varlistentry> @@ -216,8 +229,8 @@ $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello'; -$headers = 'From: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" . - 'Reply-To: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" . +$headers = 'From: [EMAIL PROTECTED]' . "\r\n" . + 'Reply-To: [EMAIL PROTECTED]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); @@ -236,7 +249,7 @@ <![CDATA[ <?php mail('[EMAIL PROTECTED]', 'the subject', 'the message', null, - '-fwebmaster@' . $_SERVER['SERVER_NAME']); + '[EMAIL PROTECTED]'); ?> ]]> </programlisting>