<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Server 2013 --> <!-- Example generated 01/16/21 --> <% Dim strPath, results strPath = Server.MapPath(".") & "\" ' Instantiate Object Set oSVR = Server.CreateObject("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 Set results = oSVR.ConvertPSToPDF(strPath & "PS.ps", strPath & "email.pdf") If results.ServerStatus <> 0 Then ErrorHandler "ConvertPSToPDF", results, results.ServerStatus End If ' 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 Set oSVR = Nothing ' Process Complete Response.Write "Done!" ' Error Handling Sub ErrorHandler(method, oResult, errorStatus) Response.Write("Error with " & method & ": <br/>" _ & errorStatus & "<br/>" _ & oResult.details) Response.End End Sub %>