op.mailSend

From PDF XChange PDF SDK
Jump to: navigation, search


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;
		}
	}
}