Back to Mail class

Method removeAttachment

public \Joomla\CMS\Mail\Mail
removeAttachment
(mixed $index = 0)
Unset file attachments specified by array index.
Parameters
  • int $index The numerical index of the attachment to remove
Returns
  • \Joomla\CMS\Mail\Mail Returns this object for chaining.
Since
  • 3.0.1
Class: Mail
Project: Joomla

Method removeAttachment - Source code

/**
 * Unset file attachments specified by array index.
 *
 * @param   integer  $index  The numerical index of the attachment to remove
 *
 * @return  Mail  Returns this object for chaining.
 *
 * @since   3.0.1
 */
public function removeAttachment($index = 0)
{
    if (isset($this->attachment[$index])) {
        unset($this->attachment[$index]);
    }
    return $this;
}