I need to send a pdf to a third party through a custom code, but i cant see how to to attach a file to the API, can you tell if there is a way to achieve what i need. I saw the WHMCS uses Phpmailer but i dont know how to require it and use it to send the mail. Thanks in advance.
this is how i send email normally...
$command = "sendemail";
$adminuser = "admin";
$values["customtype"] = "general";
$values["customsubject"] = "example email attachment";
$values["custommessage"] = "example with file third party";
$values["id"] = $userid;
$results = localAPI($command, $values, $adminuser);
and this is what i would i like to do...
$email = new PHPMailer();
$email->From = 'address1@example.com';
$email->FromName = 'Name';
$email->Subject = 'Message Subject';
$email->Body = $bodytext;
$email->AddAddress( 'destinationaddress@example.com' );
$file_to_attach = 'PATH_TO_FILE_HERE';
$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );
$email->Send();
Thanks...