• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/helper/mailbox/imap.php
  • Класс: BitrixMailHelperMailboxImap
  • Вызов: Imap::downloadMessage
public function downloadMessage(array &$excerpt)
{
	if (empty($excerpt['MSG_UID']) || empty($excerpt['DIR_MD5']))
	{
		return false;
	}

	$dirPath = $this->getDirsHelper()->getDirPathByHash($excerpt['DIR_MD5']);
	if (empty($dirPath))
	{
		return false;
	}

	$body = $this->client->fetch(true, $dirPath, $excerpt['MSG_UID'], '(BODY.PEEK[])', $error);

	if (false === $body)
	{
		$this->errors = new MainErrorCollection($this->client->getErrors()->toArray());

		return false;
	}

	return empty($body['BODY[]']) ? null : $body['BODY[]'];
}