We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

File Attachment in email

Received Response
21
Views
1
Comments
edited Mar 27, 2018 1:31PM in Customer Portal 1 comment

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.4

Code 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(); 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!