What's new in Customer Journeys?

Connect and learn more! ×
Email Function attachment not working — Cloud Customer Connect
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

Email Function attachment not working

Received Response
edited Jun 7, 2022 1:00PM in General Technical Discussions 2 comments


Dear All,

Please help me

I'm trying to generate one .pdf file and send mail to user, i sending mail correctly, but attached .pdf not opening due to content type issue. Error: "file damaged or decoded issue".

Below is my code:

            $email = new RNCPHP\Email();
            $email->Address = $email_1;
            $email->AddressType->ID = 0;
            $mm = new RNCPHP\MailMessage();
            $mm->To->EmailAddresses = array($from);
            $mm->Subject = "Test from RNCX";
            $mm->Body->Text = $text_body;
            $mm->Body->Html = $message;
            //$mm->Headers[] = "Content-Type: application/x-www-form-urlencoded";

                $fattach = new RNCPHP\FileAttachment();
                $fattach->ContentType ="application/pdf";  
                $fp = $fattach->makeFile();
                fwrite( $fp, "Making some notes in this text file for the Contact".date("Y-m-d h:i:s"));

Howdy, Stranger!

Log In

To view full details, sign in.


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