<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/mail.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'mail.configuration.php',
    1 => 'Настройка во время выполнения',
    2 => 'Настройка во время выполнения',
  ),
  'up' => 
  array (
    0 => 'mail.setup.php',
    1 => 'Установка и настройка',
  ),
  'prev' => 
  array (
    0 => 'mail.requirements.php',
    1 => 'Требования',
  ),
  'next' => 
  array (
    0 => 'ref.mail.php',
    1 => 'Почта',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/mail/ini.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mail.configuration" class="section">
 <h2 class="title">Настройка во время выполнения</h2>
 <p class="simpara">
Поведение функций зависит от установок в файле <var class="filename">php.ini</var>.
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Конфигурационные опции отправки писем</strong></caption>
   
    <thead>
     <tr>
      <th>Имя</th>
      <th>По умолчанию</th>
      <th>Место изменения</th>
      <th>Список изменений</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="mail.configuration.php#ini.mail.add-x-header" class="link">mail.add_x_header</a></td>
      <td>&quot;0&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

    <tr>
     <td><a href="mail.configuration.php#ini.mail.mixed_lf_and_crlf" class="link">mail.mixed_lf_and_crlf</a></td>
     <td>&quot;0&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong>|<strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
     <td>Опцию добавили в PHP 8.2.4</td>
    </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.mail.log" class="link">mail.log</a></td>
      <td>NULL</td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong>|<strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.mail.force_extra_parameters" class="link">mail.force_extra_parameters</a></td>
     <td>NULL</td>
     <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong>|<strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
     <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.smtp" class="link">SMTP</a></td>
      <td>&quot;localhost&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.smtp-port" class="link">smtp_port</a></td>
      <td>&quot;25&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.sendmail-from" class="link">sendmail_from</a></td>
      <td>NULL</td>
      <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="mail.configuration.php#ini.sendmail-path" class="link">sendmail_path</a></td>
      <td>&quot;/usr/sbin/sendmail -t -i&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

    </tbody>
   
  </table>

  Дополнительную информацию и определения режимов
INI_* даёт раздел «<a href="configuration.changes.modes.php" class="xref">Места установки параметров конфигурации</a>».
 </p>

 <p class="para">Краткое разъяснение конфигурационных
директив.</p>

 <p class="para">
  <dl>
   
    <dt id="ini.mail.add-x-header">
     <code class="parameter">mail.add_x_header</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      Добавляет заголовок <code class="literal">X-PHP-Originating-Script</code>
      с UID скрипта и названием файла.
     </p>
    </dd>
   

   
    <dt id="ini.mail.log">
     <code class="parameter">mail.log</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      Путь к лог-файлу для записи вызовов функции <span class="function"><a href="function.mail.php" class="function">mail()</a></span>.
      Записи в логе содержат полный путь до скрипта, номер строки, адрес получателя
      <code class="literal">To</code> и заголовки.
     </p>
    </dd>
   

   
    <dt id="ini.mail.mixed_lf_and_crlf">
     <code class="parameter">mail.mixed_lf_and_crlf</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      Директива возвращает разделение строк в заголовках и теле сообщений электронной почты символом LF (Line Feed).
      С включённой директивой ядро имитирует поведение PHP 7, которое не соответствовало стандарту в части перевода строк. Директиву ввели в целях совместимости PHP
      с конкретными почтовыми агентами (англ. Mail Transfer Agent, MTA), которые неправильно обрабатывают последовательность CRLF
      (Carriage Return + Line Feed) как разделитель строк в заголовках и содержимом сообщений электронной почты.
     </p>
    </dd>
   

   
    <dt id="ini.mail.force_extra_parameters">
     <code class="parameter">mail.force_extra_parameters</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      Директива принудительно добавляет заданные параметры как дополнительные аргументы для передачи
      в двоичный файл sendmail. Параметры заменяют
      значение пятого параметра функции <span class="function"><a href="function.mail.php" class="function">mail()</a></span>.
     </p>
     <span class="simpara">
      Стандартное поведение режима инициализации <strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong>
      допускает установку значения для этой опции также через директиву <code class="literal">php_value</code>
      файла <var class="filename">httpd.conf</var>, но так делать не рекомендуют.
     </span>
    </dd>
   

   
    <dt id="ini.smtp">
     <code class="parameter">SMTP</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      Опция работает только в ОС Windows: домен или IP-адрес SMTP-сервера, к которому
      обратится PHP при отправке почты функцией <span class="function"><a href="function.mail.php" class="function">mail()</a></span>.
     </p>
    </dd>
   

   
    <dt id="ini.smtp-port">
     <code class="parameter">smtp_port</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      Опция работает только в ОС Windows: порт <code class="literal">SMTP</code>-сервера, к которому
      обратится PHP при отправке почты функцией <span class="function"><a href="function.mail.php" class="function">mail()</a></span>;
      по умолчанию 25.
     </p>
    </dd>
   

   
    <dt id="ini.sendmail-from">
     <code class="parameter">sendmail_from</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      Опция работает только в ОС Windows: адрес для заголовка <code class="literal">&quot;From:&quot;</code>
      в письмах, которые отправляют напрямую через SMTP-сервер.
      Директива также устанавливает заголовок <code class="literal">&quot;Return-Path:&quot;</code>.
     </p>
    </dd>
   

   
    <dt id="ini.sendmail-path">
     <code class="parameter">sendmail_path</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      Путь до программы <strong class="command">sendmail</strong>,
      часто <var class="filename">/usr/sbin/sendmail</var>
      или <var class="filename">/usr/lib/sendmail</var>.
      Команда <strong class="command">configure</strong> пытается найти почтовый агент sendmail
      и установить значение по умолчанию автоматически, но если у команды не получается,
      путь устанавливают через эту опцию.
     </p>
     <p class="para">
      Системам, которые не отправляют письма через агента <strong class="command">sendmail</strong>,
      потребуется установить для этой директивы путь до обёртки или заменителя программы sendmail,
      если почтовая система содержит и предлагает такие альтернативы.
      Пользователи агента <a href="http://cr.yp.to/qmail.html" class="link external">&raquo;&nbsp;Qmail</a>, например,
      чаще устанавливают значение
      <var class="filename">/var/qmail/bin/sendmail</var>
      или <var class="filename"> /var/qmail/bin/qmail-inject</var>.
     </p>
     <p class="para">
      Команда <strong class="command">qmail-inject</strong> не требует дополнительных опций
      для отправки писем.
     </p>
     <p class="para">
      Директива также работает и в ОС Windows. При установке значения для директивы PHP проигнорирует
      опции <var class="varname">smtp</var>, <var class="varname">smtp_port</var> и <var class="varname">sendmail_from</var>
      и выполнит заданную команду.
     </p>
    </dd>
   
  </dl>

 </p>
</div><?php manual_footer($setup); ?>