Example #1
0
 /**
  * Add a string as an attachment file with the mail
  *
  * @param string $contentString         Content of the attachment file
  * @param string $attachmentFileName    Name of the attachment file
  * @param string $mimeType              [optional] Mime-type of the attachment file, default is null. If null will get from the given filename extension.
  * @return Email                        Return current instance of Email
  */
 public function addStringAttachment($contentString, $fileName, $mimeType = null)
 {
     if ($mimeType === null) {
         $mimeType = File::getMimeTypeFrom($fileName);
     }
     $a['mimeType'] = $mimeType;
     $a['name'] = $fileName;
     $a['content'] = $contentString;
     $this->_attachment[] = $a;
     return $this;
 }