// Process attachments // code added to the mail function if (isset($message['params']['attachments'])) { foreach ($message['params']['attachments'] as $attachment) { if (isset($attachment['filecontent'])) { $this->AddStringAttachment($attachment['filecontent'], $attachment['filename'], 'base64', $attachment['filemime']); } if (isset($attachment['filepath'])) { $this->AddAttachment($attachment['filepath'], $attachment['filename'], 'base64', $attachment['filemime']); } } }