共用方式為


WorkbookBase.SendMail(Object, Object, Object) Method

Definition

Sends the workbook by using the installed mail system.

public void SendMail (object recipients, object subject, object returnReceipt);
member this.SendMail : obj * obj * obj -> unit
Public Sub SendMail (recipients As Object, Optional subject As Object, Optional returnReceipt As Object)

Parameters

recipients
Object

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
Object

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

returnReceipt
Object

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

Examples

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.

This example is for a document-level customization.

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

Remarks

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to