Swift_EmbeddedFile::newInstance PHP Method

newInstance() public static method

Create a new EmbeddedFile.
public static newInstance ( string | Swift_OutputByteStream $data = null, string $filename = null, string $contentType = null ) : Swift_Mime_EmbeddedFile
$data string | Swift_OutputByteStream
$filename string
$contentType string
return Swift_Mime_EmbeddedFile
    public static function newInstance($data = null, $filename = null, $contentType = null)
    {
        return new self($data, $filename, $contentType);
    }

Usage Example

Example #1
0
 /**
  * Embeds an attachment into the message and returns its reference.
  *
  * @param string $data Binary or string
  * @param string $mimetype Mime type of the attachment (e.g. "text/plain", "application/octet-stream", etc.)
  * @param string|null $filename Name of the attached file
  * @return string Content ID for referencing the attachment in the HTML body
  */
 public function embedAttachment($data, $mimetype, $filename)
 {
     $part = \Swift_EmbeddedFile::newInstance($data, $mimetype, $filename);
     return $this->object->embed($part);
 }
All Usage Examples Of Swift_EmbeddedFile::newInstance