GraphClient Class
Namespace: Rebex.Net
Assembly: Rebex.Graph.dll (version 7.0.9119)
Provides methods for communication with Exchange Online (Microsoft 365) using Microsoft Graph API.
Syntax
public class GraphClient : NetworkSession, ILogWriterProvider, IDisposable
Inherited Members
Constructors
Name | Description |
---|---|
GraphClient() | Initializes Microsoft Graph client. |
Properties
Name | Description |
---|---|
DefaultLogWriter | Gets or sets a default log writer used by all new instances of NetworkSession object. Inherited from NetworkSession. |
InstanceId | Gets instance ID (intended for logging purposes). Inherited from NetworkSession. |
IsAuthenticated | Gets a value indicating whether the GraphClient object is authenticated to a server. |
IsBusy | Gets a value indicating whether there is any operation (method) in progress. |
IsConnected | Gets a value indicating whether the GraphClient object is connected to a server. |
LogWriter | Gets or sets the LogWriter used by this object. Inherited from NetworkSession. |
ProtocolVersion | Gets or sets the Microsoft Graph API protocol version to be used for sending Graph queries. |
Proxy | Gets or sets the network proxy to use to access a remote server. |
ServerName | Gets the server name, if available. Inherited from NetworkSession. |
ServerPort | Gets the server port, if available. Inherited from NetworkSession. |
Settings | Gets or sets an GraphSettings object. |
Timeout | Gets or sets the length of time in milliseconds before the operation times out. |
TlsSocket | Returns the TLS/SSL socket of secured connection. |
UserName | Gets the authenticated user name, if available. Inherited from NetworkSession. |
Methods
Name | Description |
---|---|
Connect() | Connects to the Exchange Online (Microsoft 365) server at https://graph.microsoft.com. |
Connect(String, Int32) | Connects to a server using specified port using HTTPS. |
ConnectAsync() | Begins asynchronous Connect operation. Connects to the Exchange Online (Microsoft 365) server at https://graph.microsoft.com. |
ConnectAsync(String, Int32) | Begins asynchronous Connect operation. Connects to a server using specified port using HTTPS. |
CreateFolder(GraphFolderId, String) | Creates new subfolder of in Root. |
DeleteFolder(GraphFolderId) | Deletes a Graph folder. |
DeleteMessage(GraphMessageId) | Deletes a message with the specified ID. |
DeleteMessageAsync(GraphMessageId) | Begins asynchronous DeleteMessage operation. Deletes a message with the specified ID. |
Disconnect() | Disconnects from the server. |
DisconnectAsync() | Begins asynchronous Disconnect operation. Disconnects from the server. |
Dispose() | Disposes this GraphClient object. |
GetFolderInfo(GraphFolderId) | Gets information about specified Graph folder. |
GetFolderInfoAsync(GraphFolderId) | Begins asynchronous GetFolderInfo operation. Gets information about specified Graph folder. |
GetFolderList(GraphFolderId, GraphPageView) | Gets a list of subfolders of the specified folder. Operation is shallow, which means that only first level of subfolders is returned. |
GetFolderList(GraphPageView) | Gets a list of folders in the user's mailbox root. Operation is shallow, which means subfolders are not returned. |
GetFolderListAsync(GraphFolderId, GraphPageView) | Begins asynchronous GetFolderList operation. Gets a list of subfolders of the specified folder. Operation is shallow, which means that only first level of subfolders is returned. |
GetFolderListAsync(GraphPageView) | Begins asynchronous GetFolderList operation. Gets a list of folders in the user's mailbox root. Operation is shallow, which means subfolders are not returned. |
GetHashCode() | Gets hash code for this object. Inherited from NetworkSession. |
GetMailMessage(GraphMessageId) | Downloads a MailMessage with the specified ID. |
GetMailMessageAsync(GraphMessageId) | Begins asynchronous GetMailMessage operation. Downloads a MailMessage with the specified ID. |
GetMessage(GraphMessageId, Stream) | Downloads a message with the specified ID and writes its MIME data into the supplied stream. |
GetMessage(GraphMessageId, String) | Downloads a message with the specified ID and writes its MIME data into a local file. |
GetMessageAsync(GraphMessageId, Stream) | Begins asynchronous GetMessage operation. Downloads a message with the specified ID and writes its MIME data into the supplied stream. |
GetMessageAsync(GraphMessageId, String) | Begins asynchronous GetMessage operation. Downloads a message with the specified ID and writes its MIME data into a local file. |
GetMessageInfo(GraphMessageId, GraphMessageFields) | Gets information about a message with the specified ID. |
GetMessageInfoAsync(GraphMessageId, GraphMessageFields) | Begins asynchronous GetMessageInfo operation. Gets information about a message with the specified ID. |
GetMessageList(GraphFolderId, GraphMessageFields, GraphPageView) | Gets a list of messages in the specified folder. |
GetMessageList(GraphFolderId, GraphPageView) | Gets a list of messages in the specified folder. |
GetMessageListAsync(GraphFolderId, GraphMessageFields, GraphPageView) | Begins asynchronous GetMessageList operation. Gets a list of messages in the specified folder. |
GetMessageListAsync(GraphFolderId, GraphPageView) | Begins asynchronous GetMessageList operation. Gets a list of messages in the specified folder. |
GetMimeMessage(GraphMessageId) | Downloads a MimeMessage with the specified ID. |
GetMimeMessageAsync(GraphMessageId) | Begins asynchronous GetMimeMessage operation. Downloads a MimeMessage with the specified ID. |
Login(String) | Authenticates the user to the Exchange Online (Microsoft 365) server using an OAuth access token. For detailed instructions on registering your app and obtaining the token, visit https://blog.rebex.net/oauth2-office365-rebex-mail (delegated mode) or https://blog.rebex.net/office365-graph-oauth-unattended (unattended mode). |
LoginAsync(String) | Begins asynchronous Login operation. Authenticates the user to the Exchange Online (Microsoft 365) server using an OAuth access token. For detailed instructions on registering your app and obtaining the token, visit https://blog.rebex.net/oauth2-office365-rebex-mail (delegated mode) or https://blog.rebex.net/office365-graph-oauth-unattended (unattended mode). |
MoveMessage(GraphMessageId, GraphFolderId) | Moves an existing message into the specified folder. |
MoveMessageAsync(GraphMessageId, GraphFolderId) | Begins asynchronous MoveMessage operation. Moves an existing message into the specified folder. |
Search(GraphFolderId, GraphMessageFields, GraphMessageSearchParameter[]) | Searches a folder for messages that match the specified searching criteria. |
Search(GraphFolderId, GraphMessageFields, GraphPageView, GraphMessageSearchParameter[]) | Searches a folder for messages that match the specified searching criteria. |
Search(GraphFolderId, GraphMessageSearchParameter[]) | Searches a folder for messages that match the specified searching criteria. |
Search(GraphFolderId, GraphMessageSearchQuery) | Searches a folder for messages that match the specified searching criteria. |
Search(GraphFolderId, GraphPageView, GraphMessageSearchParameter[]) | Searches a folder for messages that match the specified searching criteria. |
SearchAsync(GraphFolderId, GraphMessageFields, GraphMessageSearchParameter[]) | Begins asynchronous Search operation. Searches a folder for messages that match the specified searching criteria. |
SearchAsync(GraphFolderId, GraphMessageFields, GraphPageView, GraphMessageSearchParameter[]) | Begins asynchronous Search operation. Searches a folder for messages that match the specified searching criteria. |
SearchAsync(GraphFolderId, GraphMessageSearchParameter[]) | Begins asynchronous Search operation. Searches a folder for messages that match the specified searching criteria. |
SearchAsync(GraphFolderId, GraphMessageSearchQuery) | Begins asynchronous Search operation. Searches a folder for messages that match the specified searching criteria. |
SearchAsync(GraphFolderId, GraphPageView, GraphMessageSearchParameter[]) | Begins asynchronous Search operation. Searches a folder for messages that match the specified searching criteria. |
SendMessage(MailMessage) | Sends a mail message (and saves it to the 'Sent Items' folder). |
SendMessage(MimeMessage) | Sends a MIME message and saves it to the 'Sent Items' folder. |
SendMessage(GraphMessageId) | Sends an existing draft message and saves it to the 'Sent Items' folder. |
SendMessageAsync(MailMessage) | Begins asynchronous SendMessage operation. Sends a mail message (and saves it to the 'Sent Items' folder). |
SendMessageAsync(MimeMessage) | Begins asynchronous SendMessage operation. Sends a MIME message and saves it to the 'Sent Items' folder. |
SendMessageAsync(GraphMessageId) | Begins asynchronous SendMessage operation. Sends an existing draft message and saves it to the 'Sent Items' folder. |
SetSocketFactory(ISocketFactory) | Sets the socket factory to be used to create communication sockets. |
StoreMessage(GraphFolderId, MailMessage) | Stores a mail message into the specified folder. Only storing into Drafts is currently supported by Microsoft Graph API. |
StoreMessage(GraphFolderId, MimeMessage) | Stores a MIME message into the specified folder. Only storing into Drafts is currently supported by Microsoft Graph API. |
StoreMessageAsync(GraphFolderId, MailMessage) | Begins asynchronous StoreMessage operation. Stores a mail message into the specified folder. Only storing into Drafts is currently supported by Microsoft Graph API. |
StoreMessageAsync(GraphFolderId, MimeMessage) | Begins asynchronous StoreMessage operation. Stores a MIME message into the specified folder. Only storing into Drafts is currently supported by Microsoft Graph API. |
ToString() | Returns a string representation of this object. |
Events
Name | Description |
---|---|
ValidatingCertificate | Occurs when a server certificate needs to be validated. |