File Attachment in email
Content
Hi All,
I need to send an attachment in email from customer portal. I am having the file in asset folder.Here i mentioned my code.
It shows error as " Uncaught exception 'RightNow\Connect\v1_2\ConnectAPIError' with message 'Not Allowed: Cannot modify a read-only property; FileAttachment.URL".
how to solve this pls.
Regards,
Mohan
Version
3.4Code Snippet
$mm = new RNCPHP\MailMessage(); $mm->To->EmailAddresses = array("[email protected]"); $mm->Subject = "test"; $mm->Body->Html = "test"; $this->initAPI(); $fattach = new RNCPHP\FileAttachment(); $fattach->ContentType ="application/pdf"; $fattach->URL="https://siteurl/euf/assets/PDF/"; $fattach->FileName = "AdditionalSA.pdf"; $fattach->Name = "AdditionalSA.pdf"; logmessage($fattach); $mm->FileAttachments[0]=$fattach; $mm->Headers = array('X-Content-Type: multipart/alternative; charset=iso-8859-1'); $mm->send();
0