Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17200 программистов и 1834 робота. Сейчас ищут 1664 программиста ...

Mail_Mime::addHTMLImage()

Вернуться к: Mail_Mime

Mail_Mime::addHTMLImage()

Mail_Mime::addHTMLImage() – add image to message

Synopsis

require_once 'Mail/mime.php';

boolean addHTMLImage ( string $file , string $c_type = 'application/octet-stream' , string $name = '' , boolean $isfile = true , string $content_id = null )

If sending an HTML message with embedded images, use this function to add the image.

Parameter

  • string $file - The image file name or the image data itself

  • string $c_type - The content type of the image or file.

  • string $name - The filename of the image. Only used, if $file contains the image data.

  • boolean $isfile - Whether $file is a filename or not.

  • string $content_id - The Content-ID value to use for the embedded image. A NULL value will generate a suitably unique Content-ID. When referencing the embedded image with an <img> tag, set the "src" attribute to be "cid:whatever", where "whatever" is the Content-ID.

Return value

boolean - Returns TRUE on success, PEAR_Error on failure.

Throws

Possible PEAR_Error values
Error code Error message Reason Solution
NULL "File is not readable file_name" The file was not found or the script has not enough rights to access the file. Check the file name and path. Check user and file permissions.
NULL "Could not open file_name" The file is already opened and exclusivly locked by another application. In the most cases a programm opens the file for writing. addHTMLImage() does no file locking, so this problem is not caused by competitve callings of this function.

Note

This function can not be called statically.



Вернуться к: Mail_Mime

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware