51 lines
1.2 KiB
Swift
51 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
public struct OutgoingAttachment: Sendable, Codable, Equatable {
|
|
public var filename: String
|
|
public var mimeType: String
|
|
public var data: Data
|
|
|
|
public init(filename: String, mimeType: String, data: Data) {
|
|
self.filename = filename
|
|
self.mimeType = mimeType
|
|
self.data = data
|
|
}
|
|
}
|
|
|
|
public struct OutgoingMessage: Sendable, Codable, Equatable {
|
|
public var from: EmailAddress
|
|
public var to: [EmailAddress]
|
|
public var cc: [EmailAddress]
|
|
public var bcc: [EmailAddress]
|
|
public var subject: String
|
|
public var bodyText: String
|
|
public var inReplyTo: String?
|
|
public var references: String?
|
|
public var messageId: String
|
|
public var attachments: [OutgoingAttachment]
|
|
|
|
public init(
|
|
from: EmailAddress,
|
|
to: [EmailAddress],
|
|
cc: [EmailAddress] = [],
|
|
bcc: [EmailAddress] = [],
|
|
subject: String,
|
|
bodyText: String,
|
|
inReplyTo: String? = nil,
|
|
references: String? = nil,
|
|
messageId: String,
|
|
attachments: [OutgoingAttachment] = []
|
|
) {
|
|
self.from = from
|
|
self.to = to
|
|
self.cc = cc
|
|
self.bcc = bcc
|
|
self.subject = subject
|
|
self.bodyText = bodyText
|
|
self.inReplyTo = inReplyTo
|
|
self.references = references
|
|
self.messageId = messageId
|
|
self.attachments = attachments
|
|
}
|
|
}
|