Table of Contents

Class UsersResource.MessagesResource

Namespace
Google.Apis.Gmail.v1
Assembly
Google.Apis.Gmail.v1.dll

The "messages" collection of methods.

public class UsersResource.MessagesResource
Inheritance
UsersResource.MessagesResource
Inherited Members

Constructors

MessagesResource(IClientService)

Constructs a new resource.

public MessagesResource(IClientService service)

Parameters

service IClientService

Properties

Attachments

Gets the Attachments resource.

public virtual UsersResource.MessagesResource.AttachmentsResource Attachments { get; }

Property Value

UsersResource.MessagesResource.AttachmentsResource

Methods

BatchDelete(BatchDeleteMessagesRequest, string)

Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.

public virtual UsersResource.MessagesResource.BatchDeleteRequest BatchDelete(BatchDeleteMessagesRequest body, string userId)

Parameters

body BatchDeleteMessagesRequest

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.BatchDeleteRequest

BatchModify(BatchModifyMessagesRequest, string)

Modifies the labels on the specified messages.

public virtual UsersResource.MessagesResource.BatchModifyRequest BatchModify(BatchModifyMessagesRequest body, string userId)

Parameters

body BatchModifyMessagesRequest

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.BatchModifyRequest

Delete(string, string)

Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.

public virtual UsersResource.MessagesResource.DeleteRequest Delete(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the message to delete.

Returns

UsersResource.MessagesResource.DeleteRequest

Get(string, string)

Gets the specified message.

public virtual UsersResource.MessagesResource.GetRequest Get(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the message to retrieve.

Returns

UsersResource.MessagesResource.GetRequest

Import(Message, string)

Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.

public virtual UsersResource.MessagesResource.ImportRequest Import(Message body, string userId)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.ImportRequest

Import(Message, string, Stream, string)

Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.

public virtual UsersResource.MessagesResource.ImportMediaUpload Import(Message body, string userId, Stream stream, string contentType)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.MessagesResource.ImportMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.

Insert(Message, string)

Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.

public virtual UsersResource.MessagesResource.InsertRequest Insert(Message body, string userId)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.InsertRequest

Insert(Message, string, Stream, string)

Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.

public virtual UsersResource.MessagesResource.InsertMediaUpload Insert(Message body, string userId, Stream stream, string contentType)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.MessagesResource.InsertMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.

List(string)

Lists the messages in the user's mailbox.

public virtual UsersResource.MessagesResource.ListRequest List(string userId)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.ListRequest

Modify(ModifyMessageRequest, string, string)

Modifies the labels on the specified message.

public virtual UsersResource.MessagesResource.ModifyRequest Modify(ModifyMessageRequest body, string userId, string id)

Parameters

body ModifyMessageRequest

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the message to modify.

Returns

UsersResource.MessagesResource.ModifyRequest

Send(Message, string)

Sends the specified message to the recipients in the To, Cc, and Bcc headers.

public virtual UsersResource.MessagesResource.SendRequest Send(Message body, string userId)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

Returns

UsersResource.MessagesResource.SendRequest

Send(Message, string, Stream, string)

Sends the specified message to the recipients in the To, Cc, and Bcc headers.

public virtual UsersResource.MessagesResource.SendMediaUpload Send(Message body, string userId, Stream stream, string contentType)

Parameters

body Message

The body of the request.

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

stream Stream

The stream to upload. See remarks for further information.

contentType string

The content type of the stream to upload.

Returns

UsersResource.MessagesResource.SendMediaUpload

Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position.
  • Caller is responsible for maintaining the stream open until the upload is completed.
  • Caller is responsible for closing the stream.

Trash(string, string)

Moves the specified message to the trash.

public virtual UsersResource.MessagesResource.TrashRequest Trash(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the message to Trash.

Returns

UsersResource.MessagesResource.TrashRequest

Untrash(string, string)

Removes the specified message from the trash.

public virtual UsersResource.MessagesResource.UntrashRequest Untrash(string userId, string id)

Parameters

userId string

The user's email address. The special value me can be used to indicate the authenticated user.

id string

The ID of the message to remove from Trash.

Returns

UsersResource.MessagesResource.UntrashRequest