Documentation
¶
Overview ¶
Package o365 implements an imap client, using Office 365 Mail REST API.
Index ¶
- Variables
- func NewClient(clientID, clientSecret, redirectURL string, options ...ClientOption) *client
- func NewConfidentialTokenSource(conf *oauth2.Config, tenantID string) *confidentialTokenSource
- func NewGraphMailClient(ctx context.Context, clientID, clientSecret, tenantID, userID string) (*graphMailClient, error)
- func NewIMAPClient(c *client) imapclient.Client
- type Attachment
- type ClientOption
- type EmailAddress
- type Folder
- type Importance
- type InferenceClassificationType
- type ItemBody
- type Message
- type MultiValueLegacyExtendedProperty
- type Recipient
- type SingleValueLegacyExtendedProperty
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrNotSupported = errors.New("not supported")
Functions ¶
func NewClient ¶
func NewClient(clientID, clientSecret, redirectURL string, options ...ClientOption) *client
func NewConfidentialTokenSource ¶ added in v0.11.0
func NewGraphMailClient ¶ added in v0.11.0
func NewIMAPClient ¶
func NewIMAPClient(c *client) imapclient.Client
Types ¶
type Attachment ¶
type Attachment struct { // The date and time when the attachment was last modified. The date and time use ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' LastModifiedDateTime time.Time `json:",omitempty"` // The MIME type of the attachment. ContentType string `json:",omitempty"` // The display name of the attachment. This does not need to be the actual file name. Name string `json:",omitempty"` // The length of the attachment in bytes. Size int32 `json:",omitempty"` // true if the attachment is an inline attachment; otherwise, false. IsInline bool `json:",omitempty"` }
type ClientOption ¶
type ClientOption func(*clientOptions)
func Impersonate ¶
func Impersonate(email string) ClientOption
func ReadOnly ¶
func ReadOnly(readOnly bool) ClientOption
func TLS ¶
func TLS(certFile, keyFile string) ClientOption
func TenantID ¶ added in v0.10.0
func TenantID(tenantID string) ClientOption
func TokensFile ¶
func TokensFile(file string) ClientOption
type EmailAddress ¶
type Importance ¶
type Importance string
type InferenceClassificationType ¶
type InferenceClassificationType string
type Message ¶
type Message struct { // The date and time the message was created. // -F- Created *time.Time `json:"CreatedDateTime,omitempty"` // The date and time the message was last changed. // -F- LastModified *time.Time `json:"LastModifiedDateTime,omitempty"` // The date and time the message was sent. // -F- Sent *time.Time `json:"SentDateTime,omitempty"` // The date and time the message was received. // -FS Received *time.Time `json:"ReceivedDateTime,omitempty"` // A collection of multi-value extended properties of type MultiValueLegacyExtendedProperty. This is a navigation property. Find more information about extended properties. // WF- MultiValueExtendedProperties *MultiValueLegacyExtendedProperty `json:",omitempty"` // A collection of single-value extended properties of type SingleValueLegacyExtendedProperty. This is a navigation property. Find more information about extended properties. // WF- SingleValueExtendedProperties *SingleValueLegacyExtendedProperty `json:",omitempty"` // The mailbox owner and sender of the message. // WFS From *Recipient `json:",omitempty"` // The account that is actually used to generate the message. // WF- Sender *Recipient `json:",omitempty"` // The body of the message that is unique to the conversation. // --- UniqueBody *ItemBody `json:",omitempty"` // The body of the message. // W-- Body ItemBody `json:",omitempty"` // The importance of the message: Low = 0, Normal = 1, High = 2. // WFS Importance Importance `json:",omitempty"` // The classification of this message for the user, based on inferred relevance or importance, or on an explicit override. // WFS InferenceClassification InferenceClassificationType `json:",omitempty"` // The version of the message. // --- ChangeKey string `json:",omitempty"` // The ID of the conversation the email belongs to. // -F- ConversationID string `json:"ConversationId,omitempty"` // The unique identifier of the message. // --- ID string `json:"Id,omitempty"` // The unique identifier for the message's parent folder. // --- ParentFolderID string `json:"ParentFolderId,omitempty"` // The subject of the message. // WF- Subject string `json:",omitempty"` // The URL to open the message in Outlook Web App. // You can append an ispopout argument to the end of the URL to change how the message is displayed. If ispopout is not present or if it is set to 1, then the message is shown in a popout window. If ispopout is set to 0, then the browser will show the message in the Outlook Web App review pane. // The message will open in the browser if you are logged in to your mailbox via Outlook Web App. You will be prompted to login if you are not already logged in with the browser. // This URL can be accessed from within an iFrame. // -F- WebLink string `json:",omitempty"` // The first 255 characters of the message body content. // --S BodyPreview string `json:",omitempty"` // The Bcc recipients for the message. // W-S Bcc []Recipient `json:"BccRecipients,omitempty"` // The email addresses to use when replying. // --- ReplyTo []Recipient `json:",omitempty"` // The To recipients for the message. // W-S To []Recipient `json:"ToRecipients,omitempty"` // The Cc recipients for the message. // W-S Cc []Recipient `json:"CcRecipients,omitempty"` // The FileAttachment and ItemAttachment attachments for the message. Navigation property. // W-S Attachments []Attachment `json:",omitempty"` // The categories associated with the message. // WFS Categories []string `json:",omitempty"` // The collection of open type data extensions defined for the message. Navigation property. // -F- Extensions []string `json:",omitempty"` // Indicates whether the message has attachments. // -FS HasAttachments bool `json:",omitempty"` // Indicates whether a read receipt is requested for the message. // WF- IsDeliveryReceiptRequested bool `json:",omitempty"` // Indicates whether the message is a draft. A message is a draft if it hasn't been sent yet. // -F- IsDraft bool `json:",omitempty"` // Indicates whether the message has been read. // WF- IsRead bool `json:",omitempty"` // Indicates whether a read receipt is requested for the message. // WF- IsReadReceiptRequested bool `json:",omitempty"` }
https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#MessageResource The fields last word designates the Writable/Filterable/Searchable property of the field.
type Recipient ¶
type Recipient struct {
EmailAddress EmailAddress `json:",omitempty"`
}
Click to show internal directories.
Click to hide internal directories.