Export (0) Print
Expand All
Expand Minimize

Workbook.SendMail Method

Sends the workbook by using the installed mail system.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public virtual void SendMail (
	Object Recipients,
	[OptionalAttribute] Object Subject,
	[OptionalAttribute] Object ReturnReceipt
)

Parameters

Recipients

Specifies the name of the recipient as text, or as an array of text strings if there are multiple recipients. At least one recipient must be specified, and all recipients are added as To recipients.

Subject

Specifies the subject of the message. If this argument is omitted, the document name is used.

ReturnReceipt

true to request a return receipt. false to not request a return receipt. The default value is false.

Optional Parameters

For information on optional parameters, see Understanding Optional Parameters in COM Interop.

The following code example uses the SendMail method to send the workbook in an e-mail to a single recipient. The e-mail will have the subject "Please review" and will not request a return receipt.

private void WorkbookSendMail()
{
    this.SendMail("someone@example.com", "Please review this proposal.", false);
}

Show:
© 2014 Microsoft