Sdílet prostřednictvím


From Property

Topic Last Modified: 2006-12-01

The e-mail addresses of the principal author or authors of this message.

Applies To

IMessage Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Property From As String

HRESULT get_From(BSTR* pVal);HRESULT put_From(BSTR Val);

Parameters

  • pVal
    Returns the value of the From property as a reference to a BSTR.
  • Val
    Sets the value of the From property to the value of the BSTR.

Remarks

This property is also available as the urn:schemas:mailheader:from field (from Field) and the urn:schemas:httpmail:from field (from Field).

The string in the From property represents the messaging users designated by their full messaging addresses. See the BCC Property for more information about formatting and setting e-mail address properties.

If you do not set From before calling the Send Method, Collaboration Data Objects (CDO) uses the Sender Property instead. Either the IMessage Interface::From, or the Sender Property, or both, must be set prior to sending a message. If neither IMessage Interface::From nor Sender Property is set before calling the Send Method, an exception is raised. If you do not set the IMessage Interface::From before calling the Post Method, an exception is raised; the Sender Property is not used for NNTP.

The distinction between the IMessage Interface::From and the Sender Property is that Sender Property represents the messaging user that actually submits the message, while IMessage Interface::From designates its principal author(s). If these are the same messaging user, it is only necessary to set IMessage Interface::From, and it is recommended to leave Sender Property unset in this case.