op.mailSend

From PDF XChange PDF SDK
Jump to: navigation, search
 
Line 5: Line 5:
  
 
== Overview ==
 
== Overview ==
The operation overview...
+
The operation allows to send e-mails with given settings and attached files.
  
 
== Parameters ==
 
== Parameters ==
Line 15: 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.
This array is a list of '''[[PXV:IAFS Name|IAFS_Name]]*''' for attached files
+
 
|-
 
|-
 
| class="op_param_name" | Output
 
| class="op_param_name" | Output
Line 26: 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 01: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;
		}
	}
}