op.mailSend
From PDF XChange PDF SDK
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
{{#customTitle:op.mailSend}} | {{#customTitle:op.mailSend}} | ||
{{#parentPage:PXV:Operations|op.mailSend|operation}} | {{#parentPage:PXV:Operations|op.mailSend|operation}} | ||
− | |||
{{ToReview}} | {{ToReview}} | ||
== Overview == | == Overview == | ||
− | The operation | + | The operation allows to send e-mails with given settings and attached files. |
== Parameters == | == Parameters == | ||
Line 16: | Line 15: | ||
| class="op_param_name" | Input | | class="op_param_name" | Input | ||
| style="text-align:center" | Array | | style="text-align:center" | Array | ||
− | | Array of <code>IUnknown</code>-based objects | + | | Array of <code>IUnknown</code>-based objects containing the [[PXV:IAFS_Name|IAFS_Name]], [[PXV:IAFS_File|IAFS_File]] or [[PXV:IPXC_Document|IPXC_Document]] items that will be attached to the e-mail. |
− | + | ||
|- | |- | ||
| class="op_param_name" | Output | | class="op_param_name" | Output | ||
Line 27: | Line 25: | ||
| Dictionary with options of the operation. | | Dictionary with options of the operation. | ||
|} | |} | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void SendEmailFile(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) | ||
+ | { | ||
+ | int nID = Inst.Str2ID("op.mailSend", false); | ||
+ | PDFXEdit.IOperation Op = Inst.CreateOp(nID); | ||
+ | var input = Op.Params.Root["Input"]; | ||
+ | input.Add().v = Doc; | ||
+ | PDFXEdit.IAFS_Name impPath = fsInst.DefaultFileSys.StringToName(@"D:\picture1.png"); | ||
+ | input.Add().v = impPath; | ||
+ | PDFXEdit.ICabNode options = Op.Params.Root["Options"]; | ||
+ | options["ShowClientWindow"].v = true; | ||
+ | options["To"].v = "test@yourmail.com"; | ||
+ | options["Cc"].v = ""; | ||
+ | options["BCc"].v = ""; | ||
+ | options["Subject"].v = "Send File operation"; | ||
+ | options["Message"].v = "Test send file"; | ||
+ | try | ||
+ | { | ||
+ | Op.Do(); | ||
+ | } | ||
+ | catch (System.Runtime.InteropServices.COMException ex) | ||
+ | { | ||
+ | // Ignore HRESULT user cancel | ||
+ | if (ex.HResult != -2147023673 && ex.HResult != -2112289593) | ||
+ | { | ||
+ | throw ex; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </pre> |
Latest revision as of 00:50, 21 April 2016
Overview
The operation allows to send e-mails with given settings and attached files.
Parameters
Name | Type | Description |
---|---|---|
Input | Array | Array of IUnknown -based objects containing the IAFS_Name, IAFS_File or IPXC_Document items that will be attached to the e-mail.
|
Output | IUnknown
|
|
Options | Dictionary | Dictionary with options of the operation. |
Sample
//C# private void SendEmailFile(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) { int nID = Inst.Str2ID("op.mailSend", false); PDFXEdit.IOperation Op = Inst.CreateOp(nID); var input = Op.Params.Root["Input"]; input.Add().v = Doc; PDFXEdit.IAFS_Name impPath = fsInst.DefaultFileSys.StringToName(@"D:\picture1.png"); input.Add().v = impPath; PDFXEdit.ICabNode options = Op.Params.Root["Options"]; options["ShowClientWindow"].v = true; options["To"].v = "test@yourmail.com"; options["Cc"].v = ""; options["BCc"].v = ""; options["Subject"].v = "Send File operation"; options["Message"].v = "Test send file"; try { Op.Do(); } catch (System.Runtime.InteropServices.COMException ex) { // Ignore HRESULT user cancel if (ex.HResult != -2147023673 && ex.HResult != -2112289593) { throw ex; } } }