Documentation
¶
Index ¶
- Variables
- func BuildTextEmail(from string, to []string, cc []string, bcc []string, subject string, ...) ([]byte, error)
- func Issue(ewsAddr string, body []byte) (*http.Response, error)
- func SendMail(to []string, cc []string, bcc []string, topic string, content string, ...) (*http.Response, error)
- type Attachments
- type Body
- type CreateItem
- type DistinguishedFolderId
- type FileAttachment
- type Mailbox
- type Message
- type Messages
- type OneMailbox
- type SavedItemFolderId
- type XMailbox
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Sender string // mail or domain\account format AccessToken string // the access token for exchange web services ExchangeServerAddr string = "https://outlook.office365.com/EWS/Exchange.asmx" )
Functions ¶
func BuildTextEmail ¶
Types ¶
type Attachments ¶
type Attachments struct {
FileAttachment []FileAttachment `xml:"t:FileAttachment"`
}
type Body ¶
type Body struct { BodyType string `xml:"BodyType,attr"` // https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/body#bodytype Body []byte `xml:",chardata"` }
type CreateItem ¶
type CreateItem struct { XMLName struct{} `xml:"m:CreateItem"` MessageDisposition string `xml:"MessageDisposition,attr"` SavedItemFolderId SavedItemFolderId `xml:"m:SavedItemFolderId"` Items Messages `xml:"m:Items"` }
type DistinguishedFolderId ¶
type DistinguishedFolderId struct {
Id string `xml:"Id,attr"`
}
type FileAttachment ¶
type FileAttachment struct { Name string `xml:"t:Name"` ContentId string `xml:"t:ContentId"` ContentType string `xml:"t:ContentType"` // default: "application/octet-stream" ContentLocation string `xml:"t:ContentLocation"` // the location of the content of an attachment Size int32 `xml:"t:Size"` LastModifiedTime time.Time `xml:"t:LastModifiedTime"` IsInline bool `xml:"t:IsInline"` Content string `xml:"t:Content"` }
ContentTypes refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
type Message ¶
type Message struct { ItemClass string `xml:"t:ItemClass"` Subject string `xml:"t:Subject"` Body Body `xml:"t:Body"` Attachments Attachments `xml:"t:Attachments"` Sender OneMailbox `xml:"t:Sender"` ToRecipients XMailbox `xml:"t:ToRecipients"` CcRecipients XMailbox `xml:"t:CcRecipients"` BccRecipients XMailbox `xml:"t:BccRecipients"` IsReadReceiptRequested bool `xml:"t:IsReadReceiptRequested"` // whether a read receipt is requested for the e-mail message. IsDeliveryReceiptRequested bool `xml:"t:IsDeliveryReceiptRequested"` // whether a delivery receipt is requested for the e-mail message. }
type OneMailbox ¶
type OneMailbox struct {
Mailbox Mailbox `xml:"t:Mailbox"`
}
type SavedItemFolderId ¶
type SavedItemFolderId struct {
DistinguishedFolderId DistinguishedFolderId `xml:"t:DistinguishedFolderId"`
}
Click to show internal directories.
Click to hide internal directories.