Email Function attachment not working
Content
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:
try
{
$email = new RNCPHP\Email();
$email->Address = $email_1;
$email->AddressType->ID = 0;
$email->content_type
$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"));