<?php // Copyright (c) 2021 ActivePDF, Inc. // ActivePDF Server 2013 // Example generated 01/24/21 ?> <?php // Get current path $strPath = dirname(__FILE__) . "\\"; // Instantiate Object $oSVR = new COM("APServer.Object"); // Add an email $oSVR->AddEMail(); // Set server information $oSVR->SetSMTPInfo("0.0.0.0", 25); $oSVR->SetSMTPCredentials("john.doe", "activePDF", "asdfasdf"); // Set email addresses $oSVR->SetSenderInfo("John Doe", "john.doe@asdidlwenra.com"); $oSVR->SetReplyToInfo("John Doe", "john.doe@asdidlwenra.com"); $oSVR->SetRecipientInfo("Jane Doe", "jane.doe@asdidlwenra.com"); $oSVR->AddToCC("Jim Doe", "jim.doe@asdidlwenra.com"); $oSVR->AddToBcc("Janice Doe", "janice.doe@asdidlwenra.com"); // Subject and Body $oSVR->EMailSubject = "PDF Delivery from activePDF"; $oSVR->SetEMailBody("<html><body style='background-color: #EEE; padding: 4px;'>Here is your PDF!</body></html>", true); // Attachments - Binary attachments can be added with AddEMailBinaryAttachment $oSVR->AddEMailAttachment($strPath . "x.pdf"); // Other email options $oSVR->EMailReadReceipt = false; $oSVR->EMailAttachOutput = true; // Convert the PostScript file into PDF $results = $oSVR->ConvertPSToPDF($strPath . "PS.ps", $strPath . "email.pdf"); if ($results->ServerStatus != 0) { Error("ConvertPSToPDF", $results, $results->ServerStatus); } // If running multiple conversions in one instance: // One email can be removed before the next conversion $oSVR->RemoveEMail("john.doe@activepdf.com"); // An attachment can be removed $oSVR->ClearEMailAttachments(); // or all emails can be removed $oSVR->ClearEMails(); // Release Object $oSVR = null; // Process Complete echo "Done!"; // Error Handling function Error($method, $oResults, $errorStatus) { echo "Error with " . $method . ": <br/>" . $errorStatus . "<br/>" . $oResults->details; exit(1); } ?>