Добавить массив фотографий в письмо

Тема в разделе "Программирование", создана пользователем aleks_lv, 12.06.2016.

  1. aleks_lv
    Offline

    aleks_lv Недавно здесь

    Регистрация:
    22.02.2015
    Сообщения:
    27
    Симпатии:
    0
    Добрый
    не получается вложить в письмо массив фотографий
    есть такой массив
    с путями норма!
    когда добавляю одну фотку -все идет
    Код (PHP):
    1. array(2) {
    2.  [0]=>
    3.  string(59) "images/Снимок-экрана-2016-06-07-в-12.09.57.png"
    4.  [1]=>
    5.  string(59) "images/Снимок-экрана-2016-06-07-в-13.38.42.png"
    6. }

    пробую в лоб
    Код (PHP):
    1. $mailer->AddEmbeddedImage($upload);

    не выходит
    что не так?
     
  2.  
  3. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    смотри описание функции в libraries\vendor\phpmailer\phpmailer\class.phpmailer.php
    Код (PHP):
    1. foreach ($array as $key=>$val) {
    2.  
    3.     /**
    4.      * Add an embedded (inline) attachment from a file.
    5.      * This can include images, sounds, and just about any other document type.
    6.      * These differ from 'regular' attachments in that they are intended to be
    7.      * displayed inline with the message, not just attached for download.
    8.      * This is used in HTML messages that embed the images
    9.      * the HTML refers to using the $cid value.
    10.      * @param string $path Path to the attachment.
    11.      * @param string $cid Content ID of the attachment; Use this to reference
    12.      *        the content when using an embedded image in HTML.
    13.      * @param string $name Overrides the attachment name.
    14.      * @param string $encoding File encoding (see $Encoding).
    15.      * @param string $type File MIME type.
    16.      * @param string $disposition Disposition to use
    17.      * @return boolean True on successfully adding an attachment
    18.      *
    19.      * into file libraries\vendor\phpmailer\phpmailer\class.phpmailer.php
    20.      * public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
    21.      */
    22.  
    23.     $mailer->addEmbeddedImage($val, $this);
    24. }
     
    Последнее редактирование: 14.06.2016
    fullzero11 нравится это.
  4. aleks_lv
    Offline

    aleks_lv Недавно здесь

    Регистрация:
    22.02.2015
    Сообщения:
    27
    Симпатии:
    0
    да спасибо
    понял
     

Поделиться этой страницей

Загрузка...