public function addAttachmentFromPart($part)
{
/* Extract the data from the Horde_Mime_Part. */
$atc_file = Horde::getTempFile('impatt');
$stream = $part->getContents(array('stream' => true));
rewind($stream);
if (file_put_contents($atc_file, $stream) === false) {
throw new IMP_Compose_Exception(sprintf(_("Could not attach %s to the message."), $part->getName()));
}
return $this->_addAttachment($atc_file, ftell($stream), $part->getName(true), $part->getType());
}