Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eaa80f5db | |||
| 0501eae561 | |||
| 4b7666bb8c | |||
| f9b1d704b1 | |||
| 697e73a5e3 | |||
| d892f67ddb | |||
| 75ba1b9c0f | |||
| a24f187755 | |||
| f9e34156c6 | |||
| 35c690956d | |||
| 2725933a65 | |||
| 23360cff5f | |||
| beed3112da | |||
| 3f2a7b5c45 | |||
| 99b56a8c86 | |||
| a34267c2a3 | |||
| 6ce4e31e68 | |||
| b924fdd720 | |||
| ea7345ca02 | |||
| 51c1bc2093 | |||
| 3eb07d4750 | |||
| 1b58530701 | |||
| 496f779a07 | |||
| 08e0bd81ea | |||
| 77ebc1dfd8 | |||
| ec3fa120e5 | |||
| dbce8d5319 | |||
| b0c2a4c1f4 | |||
| 979acff232 | |||
| eb67bd618c | |||
| 737bd39423 | |||
| 15af9fd9b0 |
+2
-1
@@ -3,4 +3,5 @@
|
||||
build
|
||||
/Packages
|
||||
Package.resolved
|
||||
/*.xcodeproj
|
||||
/*.xcodeproj
|
||||
.swiftpm
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
module: SwiftSMTP
|
||||
author: IBM
|
||||
github_url: https://github.com/IBM-Swift/Swift-SMTP/
|
||||
author: IBM and Kitura project contributors
|
||||
github_url: https://github.com/Kitura/Swift-SMTP/
|
||||
|
||||
theme: fullwidth
|
||||
clean: true
|
||||
@@ -11,4 +11,4 @@ readme: README.md
|
||||
skip_undocumented: false
|
||||
hide_documentation_coverage: false
|
||||
|
||||
xcodebuild_arguments: [-project, SwiftSMTP.xcodeproj, -target, SwiftSMTP, LIBRARY_SEARCH_PATHS=.build/debug]
|
||||
xcodebuild_arguments: []
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
4.0.3
|
||||
5.1
|
||||
|
||||
+27
-3
@@ -1,19 +1,43 @@
|
||||
# Travis CI build file.
|
||||
|
||||
# whitelist (branches that should be built)
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^issue.*$/
|
||||
|
||||
# the matrix of builds should cover each combination of Swift version
|
||||
# and platform that is supported. The version of Swift used is specified
|
||||
# by .swift-version, unless SWIFT_SNAPSHOT is specified.
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: trusty
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.2.5 DOCKER_ENVIRONMENT="EMAIL PASSWORD"
|
||||
- os: linux
|
||||
dist: focal
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu20.04:5.4 DOCKER_ENVIRONMENT="EMAIL PASSWORD"
|
||||
- os: linux
|
||||
dist: focal
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu20.04:latest USE_SWIFT_DEVELOPMENT_SNAPSHOT=1 DOCKER_ENVIRONMENT="EMAIL PASSWORD"
|
||||
- os: osx
|
||||
osx_image: xcode9.1
|
||||
osx_image: xcode12.2
|
||||
sudo: required
|
||||
env: JAZZY_ELIGIBLE=true
|
||||
- os: osx
|
||||
osx_image: xcode13.2
|
||||
sudo: required
|
||||
env: USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
|
||||
|
||||
before_install:
|
||||
- git clone https://github.com/IBM-Swift/Package-Builder.git
|
||||
- git clone https://github.com/Kitura/Package-Builder.git
|
||||
|
||||
script:
|
||||
- ./Package-Builder/build-package.sh -projectDir $TRAVIS_BUILD_DIR
|
||||
|
||||
|
||||
+5
-30
@@ -1,8 +1,7 @@
|
||||
// swift-tools-version:4.0
|
||||
// swift-tools-version:5.0
|
||||
|
||||
import PackageDescription
|
||||
|
||||
#if swift(>=4.1)
|
||||
let package = Package(
|
||||
name: "SwiftSMTP",
|
||||
products: [
|
||||
@@ -11,10 +10,10 @@ let package = Package(
|
||||
targets: ["SwiftSMTP"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/BlueSSLService.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"),
|
||||
.package(url: "https://github.com/Kitura/BlueSocket.git", from: "2.0.2"),
|
||||
.package(url: "https://github.com/Kitura/BlueSSLService.git", from: "2.0.1"),
|
||||
.package(url: "https://github.com/Kitura/BlueCryptor.git", from: "2.0.1"),
|
||||
.package(url: "https://github.com/Kitura/LoggerAPI.git", from: "1.9.200"),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
@@ -25,27 +24,3 @@ let package = Package(
|
||||
dependencies: ["SwiftSMTP"]),
|
||||
]
|
||||
)
|
||||
#else
|
||||
let package = Package(
|
||||
name: "SwiftSMTP",
|
||||
products: [
|
||||
.library(
|
||||
name: "SwiftSMTP",
|
||||
targets: ["SwiftSMTP"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "0.12.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/BlueSSLService.git", from: "0.12.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "0.8.0"),
|
||||
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "SwiftSMTP",
|
||||
dependencies: ["Socket", "SSLService", "Cryptor", "LoggerAPI"]),
|
||||
.testTarget(
|
||||
name: "SwiftSMTPTests",
|
||||
dependencies: ["SwiftSMTP"]),
|
||||
]
|
||||
)
|
||||
#endif
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Swift-SMTP
|
||||
|
||||

|
||||

|
||||
|
||||
Swift SMTP client.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
@@ -15,15 +15,47 @@ Swift SMTP client.
|
||||
- Authenticate with CRAM-MD5, LOGIN, PLAIN, or XOAUTH2
|
||||
- Send emails with local file, HTML, and raw data attachments
|
||||
- Add custom headers
|
||||
- [Documentation](https://ibm-swift.github.io/Swift-SMTP/)
|
||||
- [Documentation](https://kitura.github.io/Swift-SMTP/)
|
||||
|
||||
## Swift Version
|
||||
|
||||
macOS & Linux: `Swift 4.0.3` or `Swift 4.1`
|
||||
macOS & Linux: `Swift 5.2` or above.
|
||||
|
||||
## Installation
|
||||
|
||||
You can add `SwiftSMTP` to your project using [Swift Package Manager](https://swift.org/package-manager/). If your project does not have a `Package.swift` file, create one by running `swift package init` in the root directory of your project. Then open `Package.swift` and add `SwiftSMTP` as a dependency. Be sure to add it to your desired targets as well:
|
||||
|
||||
```swift
|
||||
// swift-tools-version:4.0
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "MyProject",
|
||||
products: [
|
||||
.library(
|
||||
name: "MyProject",
|
||||
targets: ["MyProject"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/Kitura/Swift-SMTP", .upToNextMinor(from: "5.1.0")), // add the dependency
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "MyProject",
|
||||
dependencies: ["SwiftSMTP"]), // add targets
|
||||
.testTarget( // note "SwiftSMTP" (NO HYPHEN)
|
||||
name: "MyProjectTests",
|
||||
dependencies: ["MyProject"]),
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
After adding the dependency and saving, run `swift package generate-xcodeproj` in the root directory of your project. This will fetch dependencies and create an Xcode project which you can open and begin editing.
|
||||
|
||||
## Migration Guide
|
||||
|
||||
Version `4.0.0` & `3.0.0` bring breaking changes. See the quick migration guide [here](https://github.com/IBM-Swift/Swift-SMTP/blob/master/migration-guide.md).
|
||||
Version `5.0.0` brings breaking changes. See the quick migration guide [here](https://github.com/Kitura/Swift-SMTP/blob/master/migration-guide.md).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -47,15 +79,15 @@ Additional parameters of `SMTP` struct:
|
||||
public init(hostname: String,
|
||||
email: String,
|
||||
password: String,
|
||||
port: Int32 = 465,
|
||||
useTLS: Bool = true,
|
||||
port: Int32 = 587,
|
||||
tlsMode: TLSMode = .requireSTARTTLS,
|
||||
tlsConfiguration: TLSConfiguration? = nil,
|
||||
authMethods: [AuthMethod] = [],
|
||||
domainName: String = "localhost",
|
||||
timeout: UInt = 10)
|
||||
```
|
||||
|
||||
By default, the `SMTP` struct connects on port `465` and tries to connect using TLS. It also uses a `TLSConfiguration` that uses no backing certificates. Configure these to your needs. For more info on `TLSConfiguration`, view the [docs](https://ibm-swift.github.io/Swift-SMTP/Structs/TLSConfiguration.html).
|
||||
By default, the `SMTP` struct connects on port `587` and sends mail only if a TLS connection can be established. It also uses a `TLSConfiguration` that uses no backing certificates. View the [docs](https://kitura.github.io/Swift-SMTP/) for more configuration options.
|
||||
|
||||
### Send email
|
||||
|
||||
|
||||
@@ -131,24 +131,24 @@ extension Attachment {
|
||||
var dictionary = [String: String]()
|
||||
switch type {
|
||||
|
||||
case .data(let data):
|
||||
dictionary["CONTENT-TYPE"] = data.mime
|
||||
var attachmentDisposition = data.inline ? "inline" : "attachment"
|
||||
if let mime = data.name.mimeEncoded {
|
||||
attachmentDisposition.append("; filename=\"\(mime)\"")
|
||||
case .data(_, let mime, let name, let inline):
|
||||
dictionary["CONTENT-TYPE"] = mime
|
||||
var attachmentDisposition = inline ? "inline" : "attachment"
|
||||
if let mimeName = name.mimeEncoded {
|
||||
attachmentDisposition.append("; filename=\"\(mimeName)\"")
|
||||
}
|
||||
dictionary["CONTENT-DISPOSITION"] = attachmentDisposition
|
||||
|
||||
case .file(let file):
|
||||
dictionary["CONTENT-TYPE"] = file.mime
|
||||
var attachmentDisposition = file.inline ? "inline" : "attachment"
|
||||
if let mime = file.name.mimeEncoded {
|
||||
attachmentDisposition.append("; filename=\"\(mime)\"")
|
||||
case .file(_, let mime, let name, let inline):
|
||||
dictionary["CONTENT-TYPE"] = mime
|
||||
var attachmentDisposition = inline ? "inline" : "attachment"
|
||||
if let mimeName = name.mimeEncoded {
|
||||
attachmentDisposition.append("; filename=\"\(mimeName)\"")
|
||||
}
|
||||
dictionary["CONTENT-DISPOSITION"] = attachmentDisposition
|
||||
|
||||
case .html(let html):
|
||||
dictionary["CONTENT-TYPE"] = "text/html; charset=\(html.characterSet)"
|
||||
case .html(_, let characterSet, _):
|
||||
dictionary["CONTENT-TYPE"] = "text/html; charset=\(characterSet)"
|
||||
dictionary["CONTENT-DISPOSITION"] = "inline"
|
||||
}
|
||||
|
||||
@@ -179,8 +179,8 @@ extension Attachment {
|
||||
}
|
||||
|
||||
var isAlternative: Bool {
|
||||
if case .html(let html) = type, html.alternative {
|
||||
return true
|
||||
if case .html(_, _, let alternative) = type {
|
||||
return alternative
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ struct AuthEncoder {
|
||||
|
||||
extension String {
|
||||
func base64Decoded() throws -> String {
|
||||
guard let data = Data(base64Encoded: self),
|
||||
guard let data = Data(base64Encoded: self, options: .ignoreUnknownCharacters),
|
||||
let base64Decoded = String(data: data, encoding: .utf8) else {
|
||||
throw SMTPError.base64DecodeFail(string: self)
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ enum Command {
|
||||
}
|
||||
case .authUser(let user): return user
|
||||
case .authPassword(let password): return password
|
||||
case .mail(let from): return "MAIL FROM: <\(from)>"
|
||||
case .rcpt(let to): return "RCPT TO: <\(to)>"
|
||||
case .mail(let from): return "MAIL FROM:<\(from)>"
|
||||
case .rcpt(let to): return "RCPT TO:<\(to)>"
|
||||
case .data: return "DATA"
|
||||
case .dataEnd: return "\(CRLF)."
|
||||
case .quit: return "QUIT"
|
||||
|
||||
@@ -28,6 +28,9 @@ extension String {
|
||||
var base64Encoded: String {
|
||||
return Data(utf8).base64EncodedString()
|
||||
}
|
||||
var base64EncodedWithLineLimit: String {
|
||||
return Data(utf8).base64EncodedString(options: .lineLength76Characters)
|
||||
}
|
||||
|
||||
var mimeEncoded: String? {
|
||||
guard let encoded = addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
**/
|
||||
|
||||
import Foundation
|
||||
import LoggerAPI
|
||||
|
||||
// Used to send the content of an email--headers, text, and attachments.
|
||||
// Should only be invoked after sending the `DATA` command to the server.
|
||||
@@ -110,9 +111,9 @@ extension DataSender {
|
||||
try send(attachmentHeader)
|
||||
|
||||
switch attachment.type {
|
||||
case .data(let data): try sendData(data.data)
|
||||
case .file(let file): try sendFile(at: file.path)
|
||||
case .html(let html): try sendHTML(html.content)
|
||||
case .data(let data, _, _, _): try sendData(data)
|
||||
case .file(let path, _, _, _): try sendFile(at: path)
|
||||
case .html(let content, _, _): try sendHTML(content)
|
||||
}
|
||||
|
||||
try send("")
|
||||
@@ -135,7 +136,7 @@ extension DataSender {
|
||||
}
|
||||
#endif
|
||||
|
||||
let encodedData = data.base64EncodedData()
|
||||
let encodedData = data.base64EncodedData(options: .lineLength76Characters)
|
||||
try send(encodedData)
|
||||
|
||||
#if os(macOS)
|
||||
@@ -162,7 +163,7 @@ extension DataSender {
|
||||
throw SMTPError.fileNotFound(path: path)
|
||||
}
|
||||
|
||||
let data = file.readDataToEndOfFile().base64EncodedData()
|
||||
let data = file.readDataToEndOfFile().base64EncodedData(options: .lineLength76Characters)
|
||||
try send(data)
|
||||
file.closeFile()
|
||||
|
||||
@@ -186,13 +187,13 @@ extension DataSender {
|
||||
}
|
||||
#endif
|
||||
|
||||
let encodedHTML = html.base64Encoded
|
||||
let encodedHTML = html.data(using: .utf8)?.base64EncodedData(options: .lineLength76Characters) ?? Data()
|
||||
try send(encodedHTML)
|
||||
|
||||
#if os(macOS)
|
||||
cache.setObject(encodedHTML as AnyObject, forKey: html as AnyObject)
|
||||
#else
|
||||
cache.setObject(NSString(string: encodedHTML) as AnyObject, forKey: NSString(string: html) as AnyObject)
|
||||
cache.setObject(NSData(data: encodedHTML) as AnyObject, forKey: NSString(string: html) as AnyObject)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -200,11 +201,13 @@ extension DataSender {
|
||||
private extension DataSender {
|
||||
// Write `text` to the socket.
|
||||
func send(_ text: String) throws {
|
||||
Log.debug("SEND: \(text)")
|
||||
try socket.write(text)
|
||||
}
|
||||
|
||||
// Write `data` to the socket.
|
||||
func send(_ data: Data) throws {
|
||||
Log.debug("SEND: data \(data.count) bytes")
|
||||
try socket.write(data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ public struct Mail {
|
||||
/// Hostname from the email address.
|
||||
public var hostname: String {
|
||||
let fullEmail = from.email
|
||||
#if swift(>=4.2)
|
||||
let atIndex = fullEmail.firstIndex(of: "@")
|
||||
#else
|
||||
let atIndex = fullEmail.index(of: "@")
|
||||
#endif
|
||||
let hostStart = fullEmail.index(after: atIndex!)
|
||||
return String(fullEmail[hostStart...])
|
||||
}
|
||||
@@ -102,7 +106,12 @@ public struct Mail {
|
||||
|
||||
private static func getAlternative(_ attachments: [Attachment]) -> (Attachment?, [Attachment]) {
|
||||
var reversed: [Attachment] = attachments.reversed()
|
||||
if let index = reversed.index(where: { $0.isAlternative }) {
|
||||
#if swift(>=4.2)
|
||||
let index = reversed.firstIndex(where: { $0.isAlternative })
|
||||
#else
|
||||
let index = reversed.index(where: { $0.isAlternative })
|
||||
#endif
|
||||
if let index = index {
|
||||
return (reversed.remove(at: index), reversed.reversed())
|
||||
}
|
||||
return (nil, attachments)
|
||||
|
||||
@@ -22,12 +22,27 @@ public struct SMTP {
|
||||
private let email: String
|
||||
private let password: String
|
||||
private let port: Int32
|
||||
private let useTLS: Bool
|
||||
private let tlsMode: TLSMode
|
||||
private let tlsConfiguration: TLSConfiguration?
|
||||
private let authMethods: [String: AuthMethod]
|
||||
private let domainName: String
|
||||
private let timeout: UInt
|
||||
|
||||
/// TLSMode enum for what form of connection security to enforce.
|
||||
public enum TLSMode {
|
||||
/// Upgrades the connection to TLS if STARTLS command is received, else sends mail without security.
|
||||
case normal
|
||||
|
||||
/// Send mail over plaintext and ignore STARTTLS commands and TLS options. Could throw an error if server requires TLS.
|
||||
case ignoreTLS
|
||||
|
||||
/// Only send mail after an initial successful TLS connection. Connection will fail if a TLS connection cannot be established. The default port, 587, will likely need to be adjusted depending on your server.
|
||||
case requireTLS
|
||||
|
||||
/// Expect a STARTTLS command from the server and require the connection is upgraded to TLS. Will throw if the server does not issue a STARTTLS command.
|
||||
case requireSTARTTLS
|
||||
}
|
||||
|
||||
/// Initializes an `SMTP` instance.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -35,8 +50,7 @@ public struct SMTP {
|
||||
/// - email: Username to log in to server.
|
||||
/// - password: Password to log in to server, or access token if using XOAUTH2 authorization method.
|
||||
/// - port: Port to connect to the server on. Defaults to `465`.
|
||||
/// - useTLS: `Bool` indicating whether to connect with TLS. Your server must support the `STARTTLS` command.
|
||||
/// Defaults to `true`.
|
||||
/// - tlsMode: TLSMode `enum` indicating what form of connection security to use.
|
||||
/// - tlsConfiguration: `TLSConfiguration` used to connect with TLS. If nil, a configuration with no backing
|
||||
/// certificates is used. See `TLSConfiguration` for other configuration options.
|
||||
/// - authMethods: `AuthMethod`s to use to log in to the server. If blank, tries all supported methods.
|
||||
@@ -50,8 +64,8 @@ public struct SMTP {
|
||||
public init(hostname: String,
|
||||
email: String,
|
||||
password: String,
|
||||
port: Int32 = 465,
|
||||
useTLS: Bool = true,
|
||||
port: Int32 = 587,
|
||||
tlsMode: TLSMode = .requireSTARTTLS,
|
||||
tlsConfiguration: TLSConfiguration? = nil,
|
||||
authMethods: [AuthMethod] = [],
|
||||
domainName: String = "localhost",
|
||||
@@ -60,7 +74,7 @@ public struct SMTP {
|
||||
self.email = email
|
||||
self.password = password
|
||||
self.port = port
|
||||
self.useTLS = useTLS
|
||||
self.tlsMode = tlsMode
|
||||
self.tlsConfiguration = tlsConfiguration
|
||||
|
||||
let _authMethods = !authMethods.isEmpty ? authMethods : [
|
||||
@@ -85,13 +99,13 @@ public struct SMTP {
|
||||
/// - mail: `Mail` object to send.
|
||||
/// - completion: Callback when sending finishes. `Error` is nil on success. (optional)
|
||||
public func send(_ mail: Mail, completion: ((Error?) -> Void)? = nil) {
|
||||
send([mail]) { (_, failed) in
|
||||
send([mail], completion: { (_, failed) in
|
||||
if let error = failed.first?.1 {
|
||||
completion?(error)
|
||||
} else {
|
||||
completion?(nil)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Send multiple emails.
|
||||
@@ -126,7 +140,7 @@ public struct SMTP {
|
||||
email: email,
|
||||
password: password,
|
||||
port: port,
|
||||
useTLS: useTLS,
|
||||
tlsMode: tlsMode,
|
||||
tlsConfiguration: tlsConfiguration,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
|
||||
@@ -30,8 +30,8 @@ public enum SMTPError: Error, CustomStringConvertible {
|
||||
/// File not found at path while trying to send file `Attachment`.
|
||||
case fileNotFound(path: String)
|
||||
|
||||
/// The preferred `AuthMethod`s could not be found. Connecting with `SSL` may be required.
|
||||
case noSupportedAuthMethods(hostname: String)
|
||||
/// The preferred `AuthMethod`s could not be found, or your server is sending back a STARTTLS command and requires a connection upgrade.
|
||||
case noAuthMethodsOrRequiresTLS(hostname: String)
|
||||
|
||||
// Sender
|
||||
/// Mail has no recipients.
|
||||
@@ -50,6 +50,9 @@ public enum SMTPError: Error, CustomStringConvertible {
|
||||
// User
|
||||
/// Invalid email provided for `User`.
|
||||
case invalidEmail(email: String)
|
||||
|
||||
/// STARTTLS was required but the server did not request it.
|
||||
case requiredSTARTTLS
|
||||
|
||||
/// Description of the `SMTPError`.
|
||||
public var description: String {
|
||||
@@ -57,12 +60,13 @@ public enum SMTPError: Error, CustomStringConvertible {
|
||||
case .base64DecodeFail(let s): return "Error decoding string: \(s)."
|
||||
case .md5HashChallengeFail: return "Hashing server challenge with MD5 algorithm failed."
|
||||
case .fileNotFound(let p): return "File not found at path while trying to send file `Attachment`: \(p)."
|
||||
case .noSupportedAuthMethods(let hostname): return "The preferred authorization methods could not be found on \(hostname). Connecting with SSL may be required."
|
||||
case .noAuthMethodsOrRequiresTLS(let hostname): return "The preferred authorization methods could not be found on \(hostname), or your server is sending back a STARTTLS command and requires a connection upgrade."
|
||||
case .noRecipients: return "An email requires at least one recipient."
|
||||
case .createEmailRegexFailed: return "Failed to create RegularExpression that can check if an email is valid."
|
||||
case .badResponse(let command, let response): return "Bad response received for command. command: (\(command)), response: \(response)"
|
||||
case .convertDataUTF8Fail(let buf): return "Error converting Data read from socket to a String: \(buf)."
|
||||
case .invalidEmail(let email): return "Invalid email provided for User: \(email)."
|
||||
case .requiredSTARTTLS: return "STARTTLS was required but the server did not issue a STARTTLS command."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ struct SMTPSocket {
|
||||
email: String,
|
||||
password: String,
|
||||
port: Int32,
|
||||
useTLS: Bool,
|
||||
tlsMode: SMTP.TLSMode,
|
||||
tlsConfiguration: TLSConfiguration?,
|
||||
authMethods: [String: AuthMethod],
|
||||
domainName: String,
|
||||
timeout: UInt) throws {
|
||||
socket = try Socket.create()
|
||||
if useTLS {
|
||||
if tlsMode == .requireTLS {
|
||||
if let tlsConfiguration = tlsConfiguration {
|
||||
socket.delegate = try tlsConfiguration.makeSSLService()
|
||||
} else {
|
||||
@@ -40,7 +40,14 @@ struct SMTPSocket {
|
||||
}
|
||||
try socket.connect(to: hostname, port: port, timeout: timeout * 1000)
|
||||
try parseResponses(readFromSocket(), command: .connect)
|
||||
let serverOptions = try getServerOptions(domainName: domainName)
|
||||
var serverOptions = try getServerOptions(domainName: domainName)
|
||||
if tlsMode == .requireSTARTTLS || tlsMode == .normal {
|
||||
if try doStarttls(serverOptions: serverOptions, tlsConfiguration: tlsConfiguration) {
|
||||
serverOptions = try getServerOptions(domainName: domainName)
|
||||
} else if tlsMode == .requireSTARTTLS {
|
||||
throw SMTPError.requiredSTARTTLS
|
||||
}
|
||||
}
|
||||
let authMethod = try getAuthMethod(authMethods: authMethods, serverOptions: serverOptions, hostname: hostname)
|
||||
try login(authMethod: authMethod, email: email, password: password)
|
||||
}
|
||||
@@ -152,7 +159,29 @@ private extension SMTPSocket {
|
||||
}
|
||||
}
|
||||
}
|
||||
throw SMTPError.noSupportedAuthMethods(hostname: hostname)
|
||||
throw SMTPError.noAuthMethodsOrRequiresTLS(hostname: hostname)
|
||||
}
|
||||
|
||||
func doStarttls(serverOptions: [Response], tlsConfiguration: TLSConfiguration?) throws -> Bool {
|
||||
for option in serverOptions {
|
||||
if option.message == "STARTTLS" {
|
||||
try starttls(tlsConfiguration: tlsConfiguration)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func starttls(tlsConfiguration: TLSConfiguration?) throws {
|
||||
try send(.starttls)
|
||||
// Upgrade the socket to SSL/TLS
|
||||
if let tlsConfiguration = tlsConfiguration {
|
||||
socket.delegate = try tlsConfiguration.makeSSLService()
|
||||
} else {
|
||||
socket.delegate = try TLSConfiguration().makeSSLService()
|
||||
}
|
||||
try socket.delegate?.initialize(asServer: false)
|
||||
try socket.delegate?.onConnect(socket: socket)
|
||||
}
|
||||
|
||||
func login(authMethod: AuthMethod, email: String, password: String) throws {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Foundation
|
||||
import SSLService
|
||||
|
||||
/// Configuration for connecting with TLS. For more info, see https://github.com/IBM-Swift/BlueSSLService.
|
||||
/// Configuration for connecting with TLS. For more info, see https://github.com/Kitura/BlueSSLService.
|
||||
public struct TLSConfiguration {
|
||||
private let configuration: SSLService.Configuration
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ extension MutableCollection {
|
||||
guard c > 1 else { return }
|
||||
|
||||
for (firstUnshuffled, unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
|
||||
let d: IndexDistance = numericCast(random() % numericCast(unshuffledCount))
|
||||
let d: Int = numericCast(random() % numericCast(unshuffledCount))
|
||||
guard d != 0 else { continue }
|
||||
let i = index(firstUnshuffled, offsetBy: d)
|
||||
self.swapAt(firstUnshuffled, i)
|
||||
@@ -50,4 +50,5 @@ XCTMain([
|
||||
testCase(TestDataSender.allTests.shuffled()),
|
||||
testCase(TestMailSender.allTests.shuffled()),
|
||||
testCase(TestMiscellaneous.allTests.shuffled()),
|
||||
testCase(TestSMTPSocket.allTests.shuffled())].shuffled())
|
||||
testCase(TestSMTPSocket.allTests.shuffled()),
|
||||
testCase(TestTLSMode.allTests.shuffled())].shuffled())
|
||||
|
||||
@@ -25,11 +25,11 @@ let testDuration: Double = 15
|
||||
|
||||
// 📧📧📧 Fill in your own SMTP login info for local testing
|
||||
// ⚠️⚠️⚠️ DO NOT CHECK IN YOUR EMAIL CREDENTALS!!!
|
||||
let hostname = "smtp.gmail.com"
|
||||
let hostname = "mail.kitura.dev"
|
||||
let myEmail: String? = nil
|
||||
let myPassword: String? = nil
|
||||
let port: Int32 = 465
|
||||
let useTLS = true
|
||||
let portTLS: Int32 = 465
|
||||
let portPlain: Int32 = 2525
|
||||
let authMethods: [String: AuthMethod] = [
|
||||
AuthMethod.cramMD5.rawValue: .cramMD5,
|
||||
AuthMethod.login.rawValue: .login,
|
||||
@@ -59,12 +59,21 @@ let password: String = {
|
||||
}()
|
||||
|
||||
let senderEmailDomain: String = {
|
||||
if let atIndex = email.index(of: "@") {
|
||||
let domainStart = email.index(after: atIndex)
|
||||
#if swift(>=5)
|
||||
if let atIndex = email.firstIndex(of: "@") {
|
||||
let domainStart = email.index(after: atIndex)
|
||||
return String(email[domainStart...])
|
||||
} else {
|
||||
return "gmail.com"
|
||||
}
|
||||
#else
|
||||
if let atIndex = email.index(of: "@") {
|
||||
let domainStart = email.index(after: atIndex)
|
||||
return String(email[domainStart...])
|
||||
} else {
|
||||
return "gmail.com"
|
||||
}
|
||||
#endif
|
||||
}()
|
||||
|
||||
let testsDir: String = {
|
||||
@@ -96,8 +105,41 @@ let multipleMessageIdsMsg = "More than one Message-Id header found"
|
||||
|
||||
// https://www.base64decode.org/
|
||||
let randomText1 = "Picture removal detract earnest is by. Esteems met joy attempt way clothes yet demesne tedious. Replying an marianne do it an entrance advanced. Two dare say play when hold. Required bringing me material stanhill jointure is as he. Mutual indeed yet her living result matter him bed whence."
|
||||
|
||||
let randomText1Encoded = "UGljdHVyZSByZW1vdmFsIGRldHJhY3QgZWFybmVzdCBpcyBieS4gRXN0ZWVtcyBtZXQgam95IGF0dGVtcHQgd2F5IGNsb3RoZXMgeWV0IGRlbWVzbmUgdGVkaW91cy4gUmVwbHlpbmcgYW4gbWFyaWFubmUgZG8gaXQgYW4gZW50cmFuY2UgYWR2YW5jZWQuIFR3byBkYXJlIHNheSBwbGF5IHdoZW4gaG9sZC4gUmVxdWlyZWQgYnJpbmdpbmcgbWUgbWF0ZXJpYWwgc3RhbmhpbGwgam9pbnR1cmUgaXMgYXMgaGUuIE11dHVhbCBpbmRlZWQgeWV0IGhlciBsaXZpbmcgcmVzdWx0IG1hdHRlciBoaW0gYmVkIHdoZW5jZS4="
|
||||
let randomText1EncodedWithLineLimit = """
|
||||
UGljdHVyZSByZW1vdmFsIGRldHJhY3QgZWFybmVzdCBpcyBieS4gRXN0ZWVtcyBtZXQgam95IGF0
|
||||
dGVtcHQgd2F5IGNsb3RoZXMgeWV0IGRlbWVzbmUgdGVkaW91cy4gUmVwbHlpbmcgYW4gbWFyaWFu
|
||||
bmUgZG8gaXQgYW4gZW50cmFuY2UgYWR2YW5jZWQuIFR3byBkYXJlIHNheSBwbGF5IHdoZW4gaG9s
|
||||
ZC4gUmVxdWlyZWQgYnJpbmdpbmcgbWUgbWF0ZXJpYWwgc3RhbmhpbGwgam9pbnR1cmUgaXMgYXMg
|
||||
aGUuIE11dHVhbCBpbmRlZWQgeWV0IGhlciBsaXZpbmcgcmVzdWx0IG1hdHRlciBoaW0gYmVkIHdo
|
||||
ZW5jZS4=
|
||||
""".replacingOccurrences(of: "\n", with: "\r\n")
|
||||
|
||||
let randomText2 = "Brillo viento gas esa contar hay. Alla no toda lune faro daba en pero. Ir rumiar altura id venian. El robusto hablado ya diarios tu hacerla mermado. Las sus renunciaba llamaradas misteriosa doscientas favorcillo dos pie. Una era fue pedirselos periodicos doscientas actualidad con. Exigian un en oh algunos adivino parezca notario yo. Eres oro dos mal lune vivo sepa les seda. Tio energia una esa abultar por tufillo sirenas persona suspiro. Me pandero tardaba pedirme puertas so senales la."
|
||||
|
||||
let randomText2Encoded = "QnJpbGxvIHZpZW50byBnYXMgZXNhIGNvbnRhciBoYXkuIEFsbGEgbm8gdG9kYSBsdW5lIGZhcm8gZGFiYSBlbiBwZXJvLiBJciBydW1pYXIgYWx0dXJhIGlkIHZlbmlhbi4gRWwgcm9idXN0byBoYWJsYWRvIHlhIGRpYXJpb3MgdHUgaGFjZXJsYSBtZXJtYWRvLiBMYXMgc3VzIHJlbnVuY2lhYmEgbGxhbWFyYWRhcyBtaXN0ZXJpb3NhIGRvc2NpZW50YXMgZmF2b3JjaWxsbyBkb3MgcGllLiBVbmEgZXJhIGZ1ZSBwZWRpcnNlbG9zIHBlcmlvZGljb3MgZG9zY2llbnRhcyBhY3R1YWxpZGFkIGNvbi4gRXhpZ2lhbiB1biBlbiBvaCBhbGd1bm9zIGFkaXZpbm8gcGFyZXpjYSBub3RhcmlvIHlvLiBFcmVzIG9ybyBkb3MgbWFsIGx1bmUgdml2byBzZXBhIGxlcyBzZWRhLiBUaW8gZW5lcmdpYSB1bmEgZXNhIGFidWx0YXIgcG9yIHR1ZmlsbG8gc2lyZW5hcyBwZXJzb25hIHN1c3Bpcm8uIE1lIHBhbmRlcm8gdGFyZGFiYSBwZWRpcm1lIHB1ZXJ0YXMgc28gc2VuYWxlcyBsYS4="
|
||||
let randomText2EncodedWithLineLimit = """
|
||||
QnJpbGxvIHZpZW50byBnYXMgZXNhIGNvbnRhciBoYXkuIEFsbGEgbm8gdG9kYSBsdW5lIGZhcm8g
|
||||
ZGFiYSBlbiBwZXJvLiBJciBydW1pYXIgYWx0dXJhIGlkIHZlbmlhbi4gRWwgcm9idXN0byBoYWJs
|
||||
YWRvIHlhIGRpYXJpb3MgdHUgaGFjZXJsYSBtZXJtYWRvLiBMYXMgc3VzIHJlbnVuY2lhYmEgbGxh
|
||||
bWFyYWRhcyBtaXN0ZXJpb3NhIGRvc2NpZW50YXMgZmF2b3JjaWxsbyBkb3MgcGllLiBVbmEgZXJh
|
||||
IGZ1ZSBwZWRpcnNlbG9zIHBlcmlvZGljb3MgZG9zY2llbnRhcyBhY3R1YWxpZGFkIGNvbi4gRXhp
|
||||
Z2lhbiB1biBlbiBvaCBhbGd1bm9zIGFkaXZpbm8gcGFyZXpjYSBub3RhcmlvIHlvLiBFcmVzIG9y
|
||||
byBkb3MgbWFsIGx1bmUgdml2byBzZXBhIGxlcyBzZWRhLiBUaW8gZW5lcmdpYSB1bmEgZXNhIGFi
|
||||
dWx0YXIgcG9yIHR1ZmlsbG8gc2lyZW5hcyBwZXJzb25hIHN1c3Bpcm8uIE1lIHBhbmRlcm8gdGFy
|
||||
ZGFiYSBwZWRpcm1lIHB1ZXJ0YXMgc28gc2VuYWxlcyBsYS4=
|
||||
""".replacingOccurrences(of: "\n", with: "\r\n")
|
||||
|
||||
let randomText3 = "Intueor veritas suo majoris attinet rem res aggredi similia mei. Disputari abducerem ob ex ha interitum conflatos concipiam. Curam plura aequo rem etc serio fecto caput. Ea posterum lectorem remanere experiar videamus gi cognitum vi. Ad invenit accepit to petitis ea usitata ad. Hoc nam quibus hos oculis cumque videam ita. Res cau infinitum quadratam sanguinem."
|
||||
|
||||
let randomText3Encoded = "SW50dWVvciB2ZXJpdGFzIHN1byBtYWpvcmlzIGF0dGluZXQgcmVtIHJlcyBhZ2dyZWRpIHNpbWlsaWEgbWVpLiBEaXNwdXRhcmkgYWJkdWNlcmVtIG9iIGV4IGhhIGludGVyaXR1bSBjb25mbGF0b3MgY29uY2lwaWFtLiBDdXJhbSBwbHVyYSBhZXF1byByZW0gZXRjIHNlcmlvIGZlY3RvIGNhcHV0LiBFYSBwb3N0ZXJ1bSBsZWN0b3JlbSByZW1hbmVyZSBleHBlcmlhciB2aWRlYW11cyBnaSBjb2duaXR1bSB2aS4gQWQgaW52ZW5pdCBhY2NlcGl0IHRvIHBldGl0aXMgZWEgdXNpdGF0YSBhZC4gSG9jIG5hbSBxdWlidXMgaG9zIG9jdWxpcyBjdW1xdWUgdmlkZWFtIGl0YS4gUmVzIGNhdSBpbmZpbml0dW0gcXVhZHJhdGFtIHNhbmd1aW5lbS4="
|
||||
let randomText3EncodedWithLineLimit = """
|
||||
SW50dWVvciB2ZXJpdGFzIHN1byBtYWpvcmlzIGF0dGluZXQgcmVtIHJlcyBhZ2dyZWRpIHNpbWls
|
||||
aWEgbWVpLiBEaXNwdXRhcmkgYWJkdWNlcmVtIG9iIGV4IGhhIGludGVyaXR1bSBjb25mbGF0b3Mg
|
||||
Y29uY2lwaWFtLiBDdXJhbSBwbHVyYSBhZXF1byByZW0gZXRjIHNlcmlvIGZlY3RvIGNhcHV0LiBF
|
||||
YSBwb3N0ZXJ1bSBsZWN0b3JlbSByZW1hbmVyZSBleHBlcmlhciB2aWRlYW11cyBnaSBjb2duaXR1
|
||||
bSB2aS4gQWQgaW52ZW5pdCBhY2NlcGl0IHRvIHBldGl0aXMgZWEgdXNpdGF0YSBhZC4gSG9jIG5h
|
||||
bSBxdWlidXMgaG9zIG9jdWxpcyBjdW1xdWUgdmlkZWFtIGl0YS4gUmVzIGNhdSBpbmZpbml0dW0g
|
||||
cXVhZHJhdGFtIHNhbmd1aW5lbS4=
|
||||
""".replacingOccurrences(of: "\n", with: "\r\n")
|
||||
|
||||
@@ -63,10 +63,10 @@ class TestMailSender: XCTestCase {
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
|
||||
let mail = Mail(from: from, to: [to], subject: #function, text: text)
|
||||
smtp.send([mail]) { _, failed in
|
||||
smtp.send([mail], completion: { _, failed in
|
||||
XCTAssert(failed.isEmpty)
|
||||
x.fulfill()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func testSendMailNoRecipient() {
|
||||
@@ -150,7 +150,7 @@ class TestMailSender: XCTestCase {
|
||||
let badUser = Mail.User(email: "")
|
||||
let badMail = Mail(from: from, to: [badUser])
|
||||
let goodMail = Mail(from: from, to: [to], subject: "Send multiple mails with fail")
|
||||
smtp.send([badMail, goodMail]) { (sent, failed) in
|
||||
smtp.send([badMail, goodMail], completion: { (sent, failed) in
|
||||
guard sent.count == 1 && failed.count == 1 else {
|
||||
XCTFail("Send did not complete with 1 mail sent and 1 mail failed.")
|
||||
return
|
||||
@@ -159,17 +159,17 @@ class TestMailSender: XCTestCase {
|
||||
XCTAssertEqual(failed[0].0.id, badMail.id, "Invalid email returned does not match the invalid email sent.")
|
||||
XCTAssertNotNil(failed[0].1, "Invalid email did not return an error when sending.")
|
||||
x.fulfill()
|
||||
}
|
||||
})
|
||||
waitForExpectations(timeout: testDuration)
|
||||
}
|
||||
|
||||
func testSendNoMail() {
|
||||
let x = expectation(description: #function)
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
smtp.send([]) { (sent, failed) in
|
||||
smtp.send([], completion: { (sent, failed) in
|
||||
XCTAssert(sent.isEmpty)
|
||||
XCTAssert(failed.isEmpty)
|
||||
x.fulfill()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,18 @@ extension TestMiscellaneous {
|
||||
XCTAssertEqual(result3, randomText3Encoded, "result: \(result3) != expected: \(randomText3Encoded)")
|
||||
}
|
||||
|
||||
func testBase64EncodedWithLineLimit() {
|
||||
let result1 = randomText1.base64EncodedWithLineLimit
|
||||
XCTAssertEqual(result1, randomText1EncodedWithLineLimit, "result: \(result1) != expected: \(randomText1Encoded)")
|
||||
|
||||
let result2 = randomText2.base64EncodedWithLineLimit
|
||||
XCTAssertEqual(result2, randomText2EncodedWithLineLimit, "result: \(result2) != expected: \(randomText2Encoded)")
|
||||
|
||||
let result3 = randomText3.base64EncodedWithLineLimit
|
||||
XCTAssertEqual(result3, randomText3EncodedWithLineLimit, "result: \(result3) != expected: \(randomText3Encoded)")
|
||||
}
|
||||
|
||||
|
||||
func testMimeEncoded() {
|
||||
let result = "Water you up to?".mimeEncoded
|
||||
let expected = "=?UTF-8?Q?Water_you_up_to??="
|
||||
|
||||
@@ -36,8 +36,8 @@ class TestSMTPSocket: XCTestCase {
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: "bad password",
|
||||
port: port,
|
||||
useTLS: useTLS,
|
||||
port: portPlain,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
@@ -65,7 +65,7 @@ class TestSMTPSocket: XCTestCase {
|
||||
email: email,
|
||||
password: password,
|
||||
port: 1,
|
||||
useTLS: useTLS,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
@@ -87,8 +87,8 @@ class TestSMTPSocket: XCTestCase {
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: port,
|
||||
useTLS: useTLS,
|
||||
port: portPlain,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: [AuthMethod.login.rawValue: .login],
|
||||
domainName: domainName,
|
||||
@@ -110,8 +110,8 @@ class TestSMTPSocket: XCTestCase {
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: port,
|
||||
useTLS: useTLS,
|
||||
port: portPlain,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: [AuthMethod.plain.rawValue: .plain],
|
||||
domainName: domainName,
|
||||
@@ -134,7 +134,7 @@ class TestSMTPSocket: XCTestCase {
|
||||
email: email,
|
||||
password: password,
|
||||
port: 0,
|
||||
useTLS: useTLS,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
@@ -156,8 +156,8 @@ class TestSMTPSocket: XCTestCase {
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: port,
|
||||
useTLS: useTLS,
|
||||
port: portPlain,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: tlsConfiguration,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* Copyright IBM Corporation 2018
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
import XCTest
|
||||
@testable import SwiftSMTP
|
||||
|
||||
class TestTLSMode: XCTestCase {
|
||||
static var allTests = [
|
||||
("testNormal", testNormal),
|
||||
/*("testIgnoreTLS", testIgnoreTLS),*/
|
||||
("testRequireTLS", testRequireTLS),
|
||||
("testRequireSTARTTLS", testRequireSTARTTLS)
|
||||
]
|
||||
|
||||
func testNormal() {
|
||||
let expectation = self.expectation(description: #function)
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
|
||||
do {
|
||||
_ = try SMTPSocket(
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: portPlain,
|
||||
tlsMode: .normal,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
timeout: timeout
|
||||
)
|
||||
expectation.fulfill()
|
||||
} catch {
|
||||
XCTFail(String(describing: error))
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
// This test is for a mail server that requires STARTTLS authentication. The current mail server being used for CI builds does not require STARTTLS for non-SSL ports. So this test cannot pass successfully.
|
||||
/*
|
||||
func testIgnoreTLS() {
|
||||
let expectation = self.expectation(description: #function)
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
|
||||
do {
|
||||
_ = try SMTPSocket(
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: portPlain,
|
||||
tlsMode: .ignoreTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
timeout: timeout
|
||||
)
|
||||
XCTFail()
|
||||
expectation.fulfill()
|
||||
} catch {
|
||||
if case SMTPError.noAuthMethodsOrRequiresTLS = error {
|
||||
expectation.fulfill()
|
||||
} else {
|
||||
XCTFail(String(describing: error))
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func testRequireTLS() {
|
||||
let expectation = self.expectation(description: #function)
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
|
||||
do {
|
||||
_ = try SMTPSocket(
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: 465,
|
||||
tlsMode: .requireTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
timeout: timeout
|
||||
)
|
||||
expectation.fulfill()
|
||||
} catch {
|
||||
XCTFail(String(describing: error))
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
func testRequireSTARTTLS() {
|
||||
let expectation = self.expectation(description: #function)
|
||||
defer { waitForExpectations(timeout: testDuration) }
|
||||
|
||||
do {
|
||||
_ = try SMTPSocket(
|
||||
hostname: hostname,
|
||||
email: email,
|
||||
password: password,
|
||||
port: portPlain,
|
||||
tlsMode: .requireSTARTTLS,
|
||||
tlsConfiguration: nil,
|
||||
authMethods: authMethods,
|
||||
domainName: domainName,
|
||||
timeout: timeout
|
||||
)
|
||||
expectation.fulfill()
|
||||
} catch {
|
||||
XCTFail(String(describing: error))
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Enumerations" class="dashAnchor"></a>
|
||||
|
||||
<a title="Enumerations Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Enumerations</h1>
|
||||
<p>The following enumerations are available globally.</p>
|
||||
|
||||
@@ -128,17 +132,13 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -160,7 +160,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span> <span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -175,8 +175,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+21
-29
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>AuthMethod</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7cramMD5A2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7cramMD5yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/cramMD5" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7cramMD5A2CmF">cramMD5</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7cramMD5yA2CmF">cramMD5</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,23 +138,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">cramMD5</span> <span class="o">=</span> <span class="s">"CRAM-MD5"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">cramMD5</span> <span class="o">=</span> <span class="s">"CRAM-MD5"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5loginA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5loginyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/login" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5loginA2CmF">login</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5loginyA2CmF">login</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,23 +165,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">login</span> <span class="o">=</span> <span class="s">"LOGIN"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">login</span> <span class="o">=</span> <span class="s">"LOGIN"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5plainA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5plainyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/plain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5plainA2CmF">plain</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5plainyA2CmF">plain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -196,23 +192,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">plain</span> <span class="o">=</span> <span class="s">"PLAIN"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">plain</span> <span class="o">=</span> <span class="s">"PLAIN"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7xoauth2A2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7xoauth2yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/xoauth2" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7xoauth2A2CmF">xoauth2</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7xoauth2yA2CmF">xoauth2</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -227,7 +219,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">xoauth2</span> <span class="o">=</span> <span class="s">"XOAUTH2"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">xoauth2</span> <span class="o">=</span> <span class="s">"XOAUTH2"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,8 +234,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+71
-76
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>SMTPError</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span> <span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailACSS6string_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/base64DecodeFail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailACSS6string_tcACmF">base64DecodeFail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/base64DecodeFail(string:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailyACSS_tcACmF">base64DecodeFail(string:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,23 +138,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">base64DecodeFail</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">base64DecodeFail</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/md5HashChallengeFail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailA2CmF">md5HashChallengeFail</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailyA2CmF">md5HashChallengeFail</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,23 +165,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">md5HashChallengeFail</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">md5HashChallengeFail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12fileNotFoundACSS4path_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/fileNotFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12fileNotFoundACSS4path_tcACmF">fileNotFound</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12fileNotFoundyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/fileNotFound(path:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12fileNotFoundyACSS_tcACmF">fileNotFound(path:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -196,23 +192,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">fileNotFound</span><span class="p">(</span><span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">fileNotFound</span><span class="p">(</span><span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22noSupportedAuthMethodsACSS8hostname_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noSupportedAuthMethods" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22noSupportedAuthMethodsACSS8hostname_tcACmF">noSupportedAuthMethods</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO26noAuthMethodsOrRequiresTLSyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noAuthMethodsOrRequiresTLS(hostname:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO26noAuthMethodsOrRequiresTLSyACSS_tcACmF">noAuthMethodsOrRequiresTLS(hostname:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -220,30 +212,26 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The preferred <code><a href="../Enums/AuthMethod.html">AuthMethod</a></code>s could not be found. Connecting with <code>SSL</code> may be required.</p>
|
||||
<p>The preferred <code><a href="../Enums/AuthMethod.html">AuthMethod</a></code>s could not be found, or your server is sending back a STARTTLS command and requires a connection upgrade.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">noSupportedAuthMethods</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">noAuthMethodsOrRequiresTLS</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12noRecipientsA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12noRecipientsyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noRecipients" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12noRecipientsA2CmF">noRecipients</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12noRecipientsyA2CmF">noRecipients</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -258,23 +246,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">noRecipients</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">noRecipients</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/createEmailRegexFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedA2CmF">createEmailRegexFailed</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedyA2CmF">createEmailRegexFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -289,23 +273,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">createEmailRegexFailed</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">createEmailRegexFailed</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO11badResponseACSS7command_SS8responsetcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/badResponse" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO11badResponseACSS7command_SS8responsetcACmF">badResponse</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO11badResponseyACSS_SStcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/badResponse(command:response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO11badResponseyACSS_SStcACmF">badResponse(command:<wbr>response:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -320,23 +300,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">badResponse</span><span class="p">(</span><span class="nv">command</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">badResponse</span><span class="p">(</span><span class="nv">command</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailAC10Foundation0E0V4data_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/convertDataUTF8Fail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailAC10Foundation0E0V4data_tcACmF">convertDataUTF8Fail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailyAC10Foundation0E0V_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/convertDataUTF8Fail(data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailyAC10Foundation0E0V_tcACmF">convertDataUTF8Fail(data:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -351,23 +327,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">convertDataUTF8Fail</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">convertDataUTF8Fail</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12invalidEmailACSS5email_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidEmail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12invalidEmailACSS5email_tcACmF">invalidEmail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12invalidEmailyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidEmail(email:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12invalidEmailyACSS_tcACmF">invalidEmail(email:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -382,17 +354,40 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">invalidEmail</span><span class="p">(</span><span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">invalidEmail</span><span class="p">(</span><span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16requiredSTARTTLSyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requiredSTARTTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16requiredSTARTTLSyA2CmF">requiredSTARTTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>STARTTLS was required but the server did not request it.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requiredSTARTTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -413,7 +408,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -428,8 +423,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+14
-21
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Structures" class="dashAnchor"></a>
|
||||
|
||||
<a title="Structures Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Structures</h1>
|
||||
<p>The following structures are available globally.</p>
|
||||
|
||||
@@ -129,17 +133,14 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Attachment</span><span class="p">:</span> <span class="kt">Equatable</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -161,17 +162,13 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -193,17 +190,13 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -217,7 +210,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/IBM-Swift/BlueSSLService">https://github.com/IBM-Swift/BlueSSLService</a>.</p>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/Kitura/BlueSSLService">https://github.com/Kitura/BlueSSLService</a>.</p>
|
||||
|
||||
<a href="Structs/TLSConfiguration.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
@@ -225,7 +218,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,8 +233,8 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,13 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Attachment</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Attachment</span><span class="p">:</span> <span class="kt">Equatable</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -118,9 +123,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVAC10Foundation4DataV4data_SS4mimeSS4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV4data4mime4name6inline17additionalHeaders18relatedAttachmentsAC10Foundation4DataV_S2SSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(data:mime:name:inline:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVAC10Foundation4DataV4data_SS4mimeSS4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(data:mime:name:inline:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV4data4mime4name6inline17additionalHeaders18relatedAttachmentsAC10Foundation4DataV_S2SSbSDyS2SGSayACGtcfc">init(data:<wbr>mime:<wbr>name:<wbr>inline:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -135,7 +140,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span>
|
||||
<span class="nv">mime</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -236,9 +241,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVACSS8filePath_SS4mimeSSSg4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV8filePath4mime4name6inline17additionalHeaders18relatedAttachmentsACSS_S2SSgSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(filePath:mime:name:inline:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVACSS8filePath_SS4mimeSSSg4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(filePath:mime:name:inline:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV8filePath4mime4name6inline17additionalHeaders18relatedAttachmentsACSS_S2SSgSbSDyS2SGSayACGtcfc">init(filePath:<wbr>mime:<wbr>name:<wbr>inline:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -253,7 +258,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">mime</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"application/octet-stream"</span><span class="p">,</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -354,9 +359,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVACSS11htmlContent_SS12characterSetSb11alternatives10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV11htmlContent12characterSet11alternative17additionalHeaders18relatedAttachmentsACSS_SSSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(htmlContent:characterSet:alternative:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVACSS11htmlContent_SS12characterSetSb11alternatives10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(htmlContent:characterSet:alternative:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV11htmlContent12characterSet11alternative17additionalHeaders18relatedAttachmentsACSS_SSSbSDyS2SGSayACGtcfc">init(htmlContent:<wbr>characterSet:<wbr>alternative:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -371,7 +376,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">htmlContent</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">htmlContent</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">characterSet</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"utf-8"</span><span class="p">,</span>
|
||||
<span class="nv">alternative</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">]</span> <span class="o">=</span> <span class="p">[:],</span>
|
||||
@@ -454,16 +459,12 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV2eeoiSbAC_ACtFZ"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV2eeoiySbAC_ACtFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV2eeoiSbAC_ACtFZ">==(_:_:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV2eeoiySbAC_ACtFZ">==(_:<wbr>_:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -478,7 +479,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -493,8 +494,8 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+27
-27
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Mail</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uuid</span> <span class="o">=</span> <span class="kt">UUID</span><span class="p">()</span><span class="o">.</span><span class="n">uuidString</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uuid</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +165,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -188,7 +192,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -215,7 +219,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,7 +246,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -269,7 +273,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">subject</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">subject</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -296,7 +300,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -324,7 +328,7 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">attachments</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">attachments</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -351,7 +355,7 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">alternative</span><span class="p">:</span> <span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">alternative</span><span class="p">:</span> <span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -361,9 +365,9 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailV17additionalHeaderss10DictionaryVyS2SGvp"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV17additionalHeadersSDyS2SGvp"></a>
|
||||
<a name="//apple_ref/swift/Property/additionalHeaders" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV17additionalHeaderss10DictionaryVyS2SGvp">additionalHeaders</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV17additionalHeadersSDyS2SGvp">additionalHeaders</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -379,7 +383,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">String</span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -406,7 +410,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -433,7 +437,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -443,9 +447,9 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailVA2C4UserV4from_SayAEG2toAG2ccAG3bccSS7subjectSS4textSayAA10AttachmentVG11attachmentss10DictionaryVyS2SG17additionalHeaderstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV4from2to2cc3bcc7subject4text11attachments17additionalHeadersA2C4UserV_SayAMGA2NS2SSayAA10AttachmentVGSDyS2SGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(from:to:cc:bcc:subject:text:attachments:additionalHeaders:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailVA2C4UserV4from_SayAEG2toAG2ccAG3bccSS7subjectSS4textSayAA10AttachmentVG11attachmentss10DictionaryVyS2SG17additionalHeaderstcfc">init(from:to:cc:bcc:subject:text:attachments:additionalHeaders:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4from2to2cc3bcc7subject4text11attachments17additionalHeadersA2C4UserV_SayAMGA2NS2SSayAA10AttachmentVGSDyS2SGtcfc">init(from:<wbr>to:<wbr>cc:<wbr>bcc:<wbr>subject:<wbr>text:<wbr>attachments:<wbr>additionalHeaders:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -460,7 +464,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">,</span>
|
||||
<span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">],</span>
|
||||
<span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
@@ -581,10 +585,6 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -606,7 +606,7 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -621,8 +621,8 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+14
-10
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>User</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +165,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,9 +175,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailV4UserVAESSSg4name_SS5emailtcfc"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV4UserV4name5emailAESSSg_SStcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(name:email:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4UserVAESSSg4name_SS5emailtcfc">init(name:email:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4UserV4name5emailAESSSg_SStcfc">init(name:<wbr>email:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -188,7 +192,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -234,8 +238,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+51
-20
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>SMTP</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,37 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0VACSS8hostname_SS5emailSS8passwords5Int32V4portSb6useTLSAA16TLSConfigurationVSg16tlsConfigurationSayAA10AuthMethodOG11authMethodsSS10domainNameSu7timeouttcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(hostname:email:password:port:useTLS:tlsConfiguration:authMethods:domainName:timeout:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0VACSS8hostname_SS5emailSS8passwords5Int32V4portSb6useTLSAA16TLSConfigurationVSg16tlsConfigurationSayAA10AuthMethodOG11authMethodsSS10domainNameSu7timeouttcfc">init(hostname:email:password:port:useTLS:tlsConfiguration:authMethods:domainName:timeout:)</a>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO"></a>
|
||||
<a name="//apple_ref/swift/Enum/TLSMode" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO">TLSMode</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>TLSMode enum for what form of connection security to enforce.</p>
|
||||
|
||||
<a href="../Structs/SMTP/TLSMode.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">TLSMode</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V8hostname5email8password4port7tlsMode0G13Configuration11authMethods10domainName7timeoutACSS_S2Ss5Int32VAC7TLSModeOAA16TLSConfigurationVSgSayAA10AuthMethodOGSSSutcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(hostname:email:password:port:tlsMode:tlsConfiguration:authMethods:domainName:timeout:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V8hostname5email8password4port7tlsMode0G13Configuration11authMethods10domainName7timeoutACSS_S2Ss5Int32VAC7TLSModeOAA16TLSConfigurationVSgSayAA10AuthMethodOGSSSutcfc">init(hostname:<wbr>email:<wbr>password:<wbr>port:<wbr>tlsMode:<wbr>tlsConfiguration:<wbr>authMethods:<wbr>domainName:<wbr>timeout:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -145,11 +177,11 @@ IPv6, then timeout, and fall back to IPv4. You can avoid this by disabling IPv6
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">465</span><span class="p">,</span>
|
||||
<span class="nv">useTLS</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">587</span><span class="p">,</span>
|
||||
<span class="nv">tlsMode</span><span class="p">:</span> <span class="kt"><a href="../Structs/SMTP/TLSMode.html">TLSMode</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">requireSTARTTLS</span><span class="p">,</span>
|
||||
<span class="nv">tlsConfiguration</span><span class="p">:</span> <span class="kt"><a href="../Structs/TLSConfiguration.html">TLSConfiguration</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">authMethods</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Enums/AuthMethod.html">AuthMethod</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">domainName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"localhost"</span><span class="p">,</span>
|
||||
@@ -212,13 +244,12 @@ IPv6, then timeout, and fall back to IPv4. You can avoid this by disabling IPv6
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>useTLS</em>
|
||||
<em>tlsMode</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p><code>Bool</code> indicating whether to connect with TLS. Your server must support the <code>STARTTLS</code> command.
|
||||
Defaults to <code>true</code>.</p>
|
||||
<p>TLSMode <code>enum</code> indicating what form of connection security to use.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -280,9 +311,9 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V4sendyAA4MailV_ys5Error_pSgcSg10completiontF"></a>
|
||||
<a name="/s:9SwiftSMTP0B0V4send_10completionyAA4MailV_ys5Error_pSgcSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4sendyAA4MailV_ys5Error_pSgcSg10completiontF">send(_:completion:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4send_10completionyAA4MailV_ys5Error_pSgcSgtF">send(_:<wbr>completion:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -297,7 +328,7 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mail</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mail</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -338,9 +369,9 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V4sendySayAA4MailVG_yAF_s5Error_pSgtcSg8progressyAG_SayAF_sAH_ptGtcSg10completiontF"></a>
|
||||
<a name="/s:9SwiftSMTP0B0V4send_8progress10completionySayAA4MailVG_yAH_s5Error_pSgtcSgyAI_SayAH_sAJ_ptGtcSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(_:progress:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4sendySayAA4MailVG_yAF_s5Error_pSgtcSg8progressyAG_SayAF_sAH_ptGtcSg10completiontF">send(_:progress:completion:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4send_8progress10completionySayAA4MailVG_yAH_s5Error_pSgtcSgyAI_SayAH_sAJ_ptGtcSgtF">send(_:<wbr>progress:<wbr>completion:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -371,7 +402,7 @@ in separate calls to <code>send</code>.</li>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mails</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">],</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mails</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">],</span>
|
||||
<span class="nv">progress</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:9SwiftSMTP8Progressa">Progress</a></span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">completion</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:9SwiftSMTP10Completiona">Completion</a></span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
@@ -434,8 +465,8 @@ corresponding <code>Error</code>s. (optional)</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TLSMode Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../../js/lunr.min.js" defer></script>
|
||||
<script src="../../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Enum/TLSMode" class="dashAnchor"></a>
|
||||
|
||||
<a title="TLSMode Enumeration Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../../index.html">
|
||||
SwiftSMTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../../index.html">SwiftSMTP Reference</a>
|
||||
<img class="carat" src="../../img/carat.png" />
|
||||
TLSMode Enumeration Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/AuthMethod.html">AuthMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/SMTPError.html">SMTPError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Structs.html">Structures</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Attachment.html">Attachment</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Mail.html">Mail</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Mail/User.html">– User</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Typealiases.html">Type Aliases</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:9SwiftSMTP10Completiona">Completion</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:9SwiftSMTP8Progressa">Progress</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content top-matter">
|
||||
<h1>TLSMode</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">TLSMode</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>TLSMode enum for what form of connection security to enforce.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO6normalyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/normal" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO6normalyA2EmF">normal</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Upgrades the connection to TLS if STARTLS command is received, else sends mail without security.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">normal</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO9ignoreTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ignoreTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO9ignoreTLSyA2EmF">ignoreTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Send mail over plaintext and ignore STARTTLS commands and TLS options. Could throw an error if server requires TLS.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">ignoreTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO10requireTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requireTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO10requireTLSyA2EmF">requireTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Only send mail after an initial successful TLS connection. Connection will fail if a TLS connection cannot be established. The default port, 587, will likely need to be adjusted depending on your server.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requireTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO15requireSTARTTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requireSTARTTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO15requireSTARTTLSyA2EmF">requireSTARTTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Expect a STARTTLS command from the server and require the connection is upgraded to TLS. Will throw if the server does not issue a STARTTLS command.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requireSTARTTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,15 +100,16 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>TLSConfiguration</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/IBM-Swift/BlueSSLService">https://github.com/IBM-Swift/BlueSSLService</a>.</p>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/Kitura/BlueSSLService">https://github.com/Kitura/BlueSSLService</a>.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg15withCipherSuite_Sb34clientAllowsSelfSignedCertificatestcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV15withCipherSuite34clientAllowsSelfSignedCertificatesACSSSg_Sbtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCipherSuite:clientAllowsSelfSignedCertificates:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg15withCipherSuite_Sb34clientAllowsSelfSignedCertificatestcfc">init(withCipherSuite:clientAllowsSelfSignedCertificates:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV15withCipherSuite34clientAllowsSelfSignedCertificatesACSSSg_Sbtcfc">init(withCipherSuite:<wbr>clientAllowsSelfSignedCertificates:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCipherSuite</span> <span class="nv">cipherSuite</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCipherSuite</span> <span class="nv">cipherSuite</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">clientAllowsSelfSignedCertificates</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
@@ -176,9 +180,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg25withCACertificateFilePath_AD016usingCertificateF0AD0d3KeyF0Sb0H15SelfSignedCertsAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV25withCACertificateFilePath016usingCertificateF00d3KeyF00H15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCACertificateFilePath:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg25withCACertificateFilePath_AD016usingCertificateF0AD0d3KeyF0Sb0H15SelfSignedCertsAD11cipherSuitetcfc">init(withCACertificateFilePath:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV25withCACertificateFilePath016usingCertificateF00d3KeyF00H15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc">init(withCACertificateFilePath:<wbr>usingCertificateFile:<wbr>withKeyFile:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -193,7 +197,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateFilePath</span> <span class="nv">caCertificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateFilePath</span> <span class="nv">caCertificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">usingCertificateFile</span> <span class="nv">certificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withKeyFile</span> <span class="nv">keyFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
@@ -274,9 +278,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg26withCACertificateDirectory_AD20usingCertificateFileAD0d3KeyI0Sb0G15SelfSignedCertsAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV26withCACertificateDirectory20usingCertificateFile0d3KeyI00G15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCACertificateDirectory:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg26withCACertificateDirectory_AD20usingCertificateFileAD0d3KeyI0Sb0G15SelfSignedCertsAD11cipherSuitetcfc">init(withCACertificateDirectory:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV26withCACertificateDirectory20usingCertificateFile0d3KeyI00G15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc">init(withCACertificateDirectory:<wbr>usingCertificateFile:<wbr>withKeyFile:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -293,7 +297,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateDirectory</span> <span class="nv">caCertificateDirPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateDirectory</span> <span class="nv">caCertificateDirPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">usingCertificateFile</span> <span class="nv">certificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withKeyFile</span> <span class="nv">keyFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
@@ -374,9 +378,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg17withChainFilePath_AD0D8PasswordSb20usingSelfSignedCertsSb012clientAllowsjK12CertificatesAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV17withChainFilePath0D8Password20usingSelfSignedCerts012clientAllowsjK12Certificates11cipherSuiteACSSSg_AIS2bAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withChainFilePath:withPassword:usingSelfSignedCerts:clientAllowsSelfSignedCertificates:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg17withChainFilePath_AD0D8PasswordSb20usingSelfSignedCertsSb012clientAllowsjK12CertificatesAD11cipherSuitetcfc">init(withChainFilePath:withPassword:usingSelfSignedCerts:clientAllowsSelfSignedCertificates:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV17withChainFilePath0D8Password20usingSelfSignedCerts012clientAllowsjK12Certificates11cipherSuiteACSSSg_AIS2bAItcfc">init(withChainFilePath:<wbr>withPassword:<wbr>usingSelfSignedCerts:<wbr>clientAllowsSelfSignedCertificates:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -393,7 +397,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withChainFilePath</span> <span class="nv">chainFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withChainFilePath</span> <span class="nv">chainFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withPassword</span> <span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">clientAllowsSelfSignedCertificates</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -441,6 +445,18 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>clientAllowsSelfSignedCertificates</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>True if, as a client, connections to self-signed servers are allowed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
@@ -464,7 +480,7 @@
|
||||
<code>
|
||||
<a name="/"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withPEMCertificateString:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/">init(withPEMCertificateString:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/">init(withPEMCertificateString:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -486,8 +502,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+10
-6
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Type Aliases" class="dashAnchor"></a>
|
||||
|
||||
<a title="Type Aliases Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Type Aliases</h1>
|
||||
<p>The following type aliases are available globally.</p>
|
||||
|
||||
@@ -127,7 +131,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Progress</span> <span class="o">=</span> <span class="p">((</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Progress</span> <span class="o">=</span> <span class="p">((</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,7 +159,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Completion</span> <span class="o">=</span> <span class="p">(([</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">],</span> <span class="p">[(</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">)])</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Completion</span> <span class="o">=</span> <span class="p">(([</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">],</span> <span class="p">[(</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">)])</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,8 +174,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+36
-9
@@ -63,6 +63,10 @@ a {
|
||||
a:hover, a:focus {
|
||||
outline: 0;
|
||||
text-decoration: underline; }
|
||||
a.discouraged {
|
||||
text-decoration: line-through; }
|
||||
a.discouraged:hover, a.discouraged:focus {
|
||||
text-decoration: underline line-through; }
|
||||
|
||||
table {
|
||||
background: #fff;
|
||||
@@ -90,10 +94,10 @@ pre {
|
||||
code {
|
||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
|
||||
|
||||
p > code, li > code {
|
||||
.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code {
|
||||
background: #f7f7f7;
|
||||
padding: .2em; }
|
||||
p > code:before, p > code:after, li > code:before, li > code:after {
|
||||
.item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after {
|
||||
letter-spacing: -.2em;
|
||||
content: "\00a0"; }
|
||||
|
||||
@@ -107,7 +111,6 @@ pre code {
|
||||
@media (min-width: 768px) {
|
||||
.content-wrapper {
|
||||
flex-direction: row; } }
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
padding: 8px;
|
||||
@@ -153,7 +156,6 @@ pre code {
|
||||
word-wrap: normal;
|
||||
background: #fbfbfb;
|
||||
border-right: 1px solid #ddd; } }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
padding-left: 0; }
|
||||
@@ -184,7 +186,6 @@ pre code {
|
||||
order: 2;
|
||||
flex: 1;
|
||||
padding-bottom: 60px; } }
|
||||
|
||||
.section {
|
||||
padding: 0 32px;
|
||||
border-bottom: 1px solid #ddd; }
|
||||
@@ -197,6 +198,8 @@ pre code {
|
||||
.section-name {
|
||||
color: #666;
|
||||
display: block; }
|
||||
.section-name p {
|
||||
margin-bottom: inherit; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
@@ -215,6 +218,22 @@ pre code {
|
||||
content: "";
|
||||
display: block; }
|
||||
|
||||
.section-name-container {
|
||||
position: relative; }
|
||||
.section-name-container .section-name-link {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin-bottom: 0; }
|
||||
.section-name-container .section-name {
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
z-index: 1; }
|
||||
.section-name-container .section-name a {
|
||||
pointer-events: auto; }
|
||||
|
||||
.item-container {
|
||||
padding: 0; }
|
||||
|
||||
@@ -225,9 +244,11 @@ pre code {
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block; }
|
||||
.item .token {
|
||||
.item .token, .item .direct-link {
|
||||
display: inline-block;
|
||||
text-indent: -20px;
|
||||
padding-left: 3px;
|
||||
margin-left: 0px;
|
||||
margin-left: 20px;
|
||||
font-size: 1rem; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
@@ -287,9 +308,9 @@ pre code {
|
||||
.language .aside-title {
|
||||
color: #4183c4; }
|
||||
|
||||
.aside-warning {
|
||||
.aside-warning, .aside-deprecated, .aside-unavailable {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
.aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
@@ -325,6 +346,7 @@ pre code {
|
||||
|
||||
html.dash .header, html.dash .breadcrumbs, html.dash .navigation {
|
||||
display: none; }
|
||||
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
|
||||
@@ -338,14 +360,17 @@ form[role=search] input {
|
||||
border-radius: 1em; }
|
||||
.loading form[role=search] input {
|
||||
background: white url(../img/spinner.gif) center right 4px no-repeat; }
|
||||
|
||||
form[role=search] .tt-menu {
|
||||
margin: 0;
|
||||
min-width: 300px;
|
||||
background: #fbfbfb;
|
||||
color: #333;
|
||||
border: 1px solid #ddd; }
|
||||
|
||||
form[role=search] .tt-highlight {
|
||||
font-weight: bold; }
|
||||
|
||||
form[role=search] .tt-suggestion {
|
||||
font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
padding: 0 8px; }
|
||||
@@ -358,11 +383,13 @@ form[role=search] .tt-suggestion {
|
||||
font-weight: normal;
|
||||
font-size: 0.9em;
|
||||
padding-left: 16px; }
|
||||
|
||||
form[role=search] .tt-suggestion:hover,
|
||||
form[role=search] .tt-suggestion.tt-cursor {
|
||||
cursor: pointer;
|
||||
background-color: #4183c4;
|
||||
color: #fff; }
|
||||
|
||||
form[role=search] .tt-suggestion:hover .doc-parent-name,
|
||||
form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
|
||||
color: #fff; }
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Enumerations" class="dashAnchor"></a>
|
||||
|
||||
<a title="Enumerations Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Enumerations</h1>
|
||||
<p>The following enumerations are available globally.</p>
|
||||
|
||||
@@ -128,17 +132,13 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -160,7 +160,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span> <span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -175,8 +175,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>AuthMethod</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AuthMethod</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7cramMD5A2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7cramMD5yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/cramMD5" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7cramMD5A2CmF">cramMD5</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7cramMD5yA2CmF">cramMD5</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,23 +138,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">cramMD5</span> <span class="o">=</span> <span class="s">"CRAM-MD5"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">cramMD5</span> <span class="o">=</span> <span class="s">"CRAM-MD5"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5loginA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5loginyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/login" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5loginA2CmF">login</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5loginyA2CmF">login</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,23 +165,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">login</span> <span class="o">=</span> <span class="s">"LOGIN"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">login</span> <span class="o">=</span> <span class="s">"LOGIN"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5plainA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO5plainyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/plain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5plainA2CmF">plain</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO5plainyA2CmF">plain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -196,23 +192,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">plain</span> <span class="o">=</span> <span class="s">"PLAIN"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">plain</span> <span class="o">=</span> <span class="s">"PLAIN"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7xoauth2A2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP10AuthMethodO7xoauth2yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/xoauth2" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7xoauth2A2CmF">xoauth2</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AuthMethodO7xoauth2yA2CmF">xoauth2</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -227,7 +219,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">xoauth2</span> <span class="o">=</span> <span class="s">"XOAUTH2"</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">xoauth2</span> <span class="o">=</span> <span class="s">"XOAUTH2"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,8 +234,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>SMTPError</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SMTPError</span> <span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailACSS6string_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/base64DecodeFail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailACSS6string_tcACmF">base64DecodeFail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/base64DecodeFail(string:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16base64DecodeFailyACSS_tcACmF">base64DecodeFail(string:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,23 +138,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">base64DecodeFail</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">base64DecodeFail</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/md5HashChallengeFail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailA2CmF">md5HashChallengeFail</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO20md5HashChallengeFailyA2CmF">md5HashChallengeFail</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -165,23 +165,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">md5HashChallengeFail</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">md5HashChallengeFail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12fileNotFoundACSS4path_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/fileNotFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12fileNotFoundACSS4path_tcACmF">fileNotFound</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12fileNotFoundyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/fileNotFound(path:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12fileNotFoundyACSS_tcACmF">fileNotFound(path:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -196,23 +192,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">fileNotFound</span><span class="p">(</span><span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">fileNotFound</span><span class="p">(</span><span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22noSupportedAuthMethodsACSS8hostname_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noSupportedAuthMethods" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22noSupportedAuthMethodsACSS8hostname_tcACmF">noSupportedAuthMethods</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO26noAuthMethodsOrRequiresTLSyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noAuthMethodsOrRequiresTLS(hostname:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO26noAuthMethodsOrRequiresTLSyACSS_tcACmF">noAuthMethodsOrRequiresTLS(hostname:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -220,30 +212,26 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The preferred <code><a href="../Enums/AuthMethod.html">AuthMethod</a></code>s could not be found. Connecting with <code>SSL</code> may be required.</p>
|
||||
<p>The preferred <code><a href="../Enums/AuthMethod.html">AuthMethod</a></code>s could not be found, or your server is sending back a STARTTLS command and requires a connection upgrade.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">noSupportedAuthMethods</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">noAuthMethodsOrRequiresTLS</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12noRecipientsA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12noRecipientsyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noRecipients" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12noRecipientsA2CmF">noRecipients</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12noRecipientsyA2CmF">noRecipients</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -258,23 +246,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">noRecipients</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">noRecipients</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedA2CmF"></a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/createEmailRegexFailed" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedA2CmF">createEmailRegexFailed</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO22createEmailRegexFailedyA2CmF">createEmailRegexFailed</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -289,23 +273,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">createEmailRegexFailed</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">createEmailRegexFailed</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO11badResponseACSS7command_SS8responsetcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/badResponse" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO11badResponseACSS7command_SS8responsetcACmF">badResponse</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO11badResponseyACSS_SStcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/badResponse(command:response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO11badResponseyACSS_SStcACmF">badResponse(command:<wbr>response:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -320,23 +300,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">badResponse</span><span class="p">(</span><span class="nv">command</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">badResponse</span><span class="p">(</span><span class="nv">command</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailAC10Foundation0E0V4data_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/convertDataUTF8Fail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailAC10Foundation0E0V4data_tcACmF">convertDataUTF8Fail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailyAC10Foundation0E0V_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/convertDataUTF8Fail(data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO19convertDataUTF8FailyAC10Foundation0E0V_tcACmF">convertDataUTF8Fail(data:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -351,23 +327,19 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">convertDataUTF8Fail</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">convertDataUTF8Fail</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12invalidEmailACSS5email_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidEmail" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12invalidEmailACSS5email_tcACmF">invalidEmail</a>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO12invalidEmailyACSS_tcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidEmail(email:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO12invalidEmailyACSS_tcACmF">invalidEmail(email:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -382,17 +354,40 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">invalidEmail</span><span class="p">(</span><span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">invalidEmail</span><span class="p">(</span><span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP9SMTPErrorO16requiredSTARTTLSyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requiredSTARTTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP9SMTPErrorO16requiredSTARTTLSyA2CmF">requiredSTARTTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>STARTTLS was required but the server did not request it.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requiredSTARTTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -413,7 +408,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -428,8 +423,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Structures" class="dashAnchor"></a>
|
||||
|
||||
<a title="Structures Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Structures</h1>
|
||||
<p>The following structures are available globally.</p>
|
||||
|
||||
@@ -129,17 +133,14 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Attachment</span><span class="p">:</span> <span class="kt">Equatable</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -161,17 +162,13 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -193,17 +190,13 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -217,7 +210,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/IBM-Swift/BlueSSLService">https://github.com/IBM-Swift/BlueSSLService</a>.</p>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/Kitura/BlueSSLService">https://github.com/Kitura/BlueSSLService</a>.</p>
|
||||
|
||||
<a href="Structs/TLSConfiguration.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
@@ -225,7 +218,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,8 +233,8 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+22
-21
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,13 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Attachment</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attachment</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Attachment</span><span class="p">:</span> <span class="kt">Equatable</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -118,9 +123,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVAC10Foundation4DataV4data_SS4mimeSS4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV4data4mime4name6inline17additionalHeaders18relatedAttachmentsAC10Foundation4DataV_S2SSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(data:mime:name:inline:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVAC10Foundation4DataV4data_SS4mimeSS4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(data:mime:name:inline:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV4data4mime4name6inline17additionalHeaders18relatedAttachmentsAC10Foundation4DataV_S2SSbSDyS2SGSayACGtcfc">init(data:<wbr>mime:<wbr>name:<wbr>inline:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -135,7 +140,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span>
|
||||
<span class="nv">mime</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -236,9 +241,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVACSS8filePath_SS4mimeSSSg4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV8filePath4mime4name6inline17additionalHeaders18relatedAttachmentsACSS_S2SSgSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(filePath:mime:name:inline:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVACSS8filePath_SS4mimeSSSg4nameSb6inlines10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(filePath:mime:name:inline:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV8filePath4mime4name6inline17additionalHeaders18relatedAttachmentsACSS_S2SSgSbSDyS2SGSayACGtcfc">init(filePath:<wbr>mime:<wbr>name:<wbr>inline:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -253,7 +258,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">filePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">mime</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"application/octet-stream"</span><span class="p">,</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -354,9 +359,9 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentVACSS11htmlContent_SS12characterSetSb11alternatives10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV11htmlContent12characterSet11alternative17additionalHeaders18relatedAttachmentsACSS_SSSbSDyS2SGSayACGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(htmlContent:characterSet:alternative:additionalHeaders:relatedAttachments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentVACSS11htmlContent_SS12characterSetSb11alternatives10DictionaryVyS2SG17additionalHeadersSayACG18relatedAttachmentstcfc">init(htmlContent:characterSet:alternative:additionalHeaders:relatedAttachments:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV11htmlContent12characterSet11alternative17additionalHeaders18relatedAttachmentsACSS_SSSbSDyS2SGSayACGtcfc">init(htmlContent:<wbr>characterSet:<wbr>alternative:<wbr>additionalHeaders:<wbr>relatedAttachments:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -371,7 +376,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">htmlContent</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">htmlContent</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">characterSet</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"utf-8"</span><span class="p">,</span>
|
||||
<span class="nv">alternative</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">]</span> <span class="o">=</span> <span class="p">[:],</span>
|
||||
@@ -454,16 +459,12 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV2eeoiSbAC_ACtFZ"></a>
|
||||
<a name="/s:9SwiftSMTP10AttachmentV2eeoiySbAC_ACtFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV2eeoiSbAC_ACtFZ">==(_:_:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP10AttachmentV2eeoiySbAC_ACtFZ">==(_:<wbr>_:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -478,7 +479,7 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Attachment</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -493,8 +494,8 @@ Different SMTP servers have different attachment size limits.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Mail</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Mail</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uuid</span> <span class="o">=</span> <span class="kt">UUID</span><span class="p">()</span><span class="o">.</span><span class="n">uuidString</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uuid</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +165,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -188,7 +192,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -215,7 +219,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,7 +246,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -269,7 +273,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">subject</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">subject</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -296,7 +300,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -324,7 +328,7 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">attachments</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">attachments</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -351,7 +355,7 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">alternative</span><span class="p">:</span> <span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">alternative</span><span class="p">:</span> <span class="kt"><a href="../Structs/Attachment.html">Attachment</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -361,9 +365,9 @@ text, the last one will be used as the alternative (all the <code>Attachments</c
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailV17additionalHeaderss10DictionaryVyS2SGvp"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV17additionalHeadersSDyS2SGvp"></a>
|
||||
<a name="//apple_ref/swift/Property/additionalHeaders" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV17additionalHeaderss10DictionaryVyS2SGvp">additionalHeaders</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV17additionalHeadersSDyS2SGvp">additionalHeaders</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -379,7 +383,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">]</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">additionalHeaders</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">String</span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -406,7 +410,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -433,7 +437,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -443,9 +447,9 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailVA2C4UserV4from_SayAEG2toAG2ccAG3bccSS7subjectSS4textSayAA10AttachmentVG11attachmentss10DictionaryVyS2SG17additionalHeaderstcfc"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV4from2to2cc3bcc7subject4text11attachments17additionalHeadersA2C4UserV_SayAMGA2NS2SSayAA10AttachmentVGSDyS2SGtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(from:to:cc:bcc:subject:text:attachments:additionalHeaders:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailVA2C4UserV4from_SayAEG2toAG2ccAG3bccSS7subjectSS4textSayAA10AttachmentVG11attachmentss10DictionaryVyS2SG17additionalHeaderstcfc">init(from:to:cc:bcc:subject:text:attachments:additionalHeaders:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4from2to2cc3bcc7subject4text11attachments17additionalHeadersA2C4UserV_SayAMGA2NS2SSayAA10AttachmentVGSDyS2SGtcfc">init(from:<wbr>to:<wbr>cc:<wbr>bcc:<wbr>subject:<wbr>text:<wbr>attachments:<wbr>additionalHeaders:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -460,7 +464,7 @@ Defaults to none. The following will be ignored: CONTENT-TYPE, CONTENT-DISPOSITI
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">,</span>
|
||||
<span class="nv">to</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">],</span>
|
||||
<span class="nv">cc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">bcc</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail/User.html">User</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
@@ -581,10 +585,6 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -606,7 +606,7 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -621,8 +621,8 @@ CONTENT-TRANSFER-ENCODING.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>User</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +165,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,9 +175,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP4MailV4UserVAESSSg4name_SS5emailtcfc"></a>
|
||||
<a name="/s:9SwiftSMTP4MailV4UserV4name5emailAESSSg_SStcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(name:email:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4UserVAESSSg4name_SS5emailtcfc">init(name:email:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP4MailV4UserV4name5emailAESSSg_SStcfc">init(name:<wbr>email:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -188,7 +192,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -234,8 +238,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,11 +100,12 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>SMTP</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SMTP</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,9 +121,37 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0VACSS8hostname_SS5emailSS8passwords5Int32V4portSb6useTLSAA16TLSConfigurationVSg16tlsConfigurationSayAA10AuthMethodOG11authMethodsSS10domainNameSu7timeouttcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(hostname:email:password:port:useTLS:tlsConfiguration:authMethods:domainName:timeout:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0VACSS8hostname_SS5emailSS8passwords5Int32V4portSb6useTLSAA16TLSConfigurationVSg16tlsConfigurationSayAA10AuthMethodOG11authMethodsSS10domainNameSu7timeouttcfc">init(hostname:email:password:port:useTLS:tlsConfiguration:authMethods:domainName:timeout:)</a>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO"></a>
|
||||
<a name="//apple_ref/swift/Enum/TLSMode" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO">TLSMode</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>TLSMode enum for what form of connection security to enforce.</p>
|
||||
|
||||
<a href="../Structs/SMTP/TLSMode.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">TLSMode</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V8hostname5email8password4port7tlsMode0G13Configuration11authMethods10domainName7timeoutACSS_S2Ss5Int32VAC7TLSModeOAA16TLSConfigurationVSgSayAA10AuthMethodOGSSSutcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(hostname:email:password:port:tlsMode:tlsConfiguration:authMethods:domainName:timeout:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V8hostname5email8password4port7tlsMode0G13Configuration11authMethods10domainName7timeoutACSS_S2Ss5Int32VAC7TLSModeOAA16TLSConfigurationVSgSayAA10AuthMethodOGSSSutcfc">init(hostname:<wbr>email:<wbr>password:<wbr>port:<wbr>tlsMode:<wbr>tlsConfiguration:<wbr>authMethods:<wbr>domainName:<wbr>timeout:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -145,11 +177,11 @@ IPv6, then timeout, and fall back to IPv4. You can avoid this by disabling IPv6
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">465</span><span class="p">,</span>
|
||||
<span class="nv">useTLS</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">587</span><span class="p">,</span>
|
||||
<span class="nv">tlsMode</span><span class="p">:</span> <span class="kt"><a href="../Structs/SMTP/TLSMode.html">TLSMode</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">requireSTARTTLS</span><span class="p">,</span>
|
||||
<span class="nv">tlsConfiguration</span><span class="p">:</span> <span class="kt"><a href="../Structs/TLSConfiguration.html">TLSConfiguration</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">authMethods</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Enums/AuthMethod.html">AuthMethod</a></span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">domainName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"localhost"</span><span class="p">,</span>
|
||||
@@ -212,13 +244,12 @@ IPv6, then timeout, and fall back to IPv4. You can avoid this by disabling IPv6
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>useTLS</em>
|
||||
<em>tlsMode</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p><code>Bool</code> indicating whether to connect with TLS. Your server must support the <code>STARTTLS</code> command.
|
||||
Defaults to <code>true</code>.</p>
|
||||
<p>TLSMode <code>enum</code> indicating what form of connection security to use.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -280,9 +311,9 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V4sendyAA4MailV_ys5Error_pSgcSg10completiontF"></a>
|
||||
<a name="/s:9SwiftSMTP0B0V4send_10completionyAA4MailV_ys5Error_pSgcSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4sendyAA4MailV_ys5Error_pSgcSg10completiontF">send(_:completion:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4send_10completionyAA4MailV_ys5Error_pSgcSgtF">send(_:<wbr>completion:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -297,7 +328,7 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mail</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mail</span><span class="p">:</span> <span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -338,9 +369,9 @@ certificates is used. See <code><a href="../Structs/TLSConfiguration.html">TLSCo
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V4sendySayAA4MailVG_yAF_s5Error_pSgtcSg8progressyAG_SayAF_sAH_ptGtcSg10completiontF"></a>
|
||||
<a name="/s:9SwiftSMTP0B0V4send_8progress10completionySayAA4MailVG_yAH_s5Error_pSgtcSgyAI_SayAH_sAJ_ptGtcSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(_:progress:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4sendySayAA4MailVG_yAF_s5Error_pSgtcSg8progressyAG_SayAF_sAH_ptGtcSg10completiontF">send(_:progress:completion:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V4send_8progress10completionySayAA4MailVG_yAH_s5Error_pSgtcSgyAI_SayAH_sAJ_ptGtcSgtF">send(_:<wbr>progress:<wbr>completion:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -371,7 +402,7 @@ in separate calls to <code>send</code>.</li>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mails</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">],</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="n">_</span> <span class="nv">mails</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/Mail.html">Mail</a></span><span class="p">],</span>
|
||||
<span class="nv">progress</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:9SwiftSMTP8Progressa">Progress</a></span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">completion</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:9SwiftSMTP10Completiona">Completion</a></span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
@@ -434,8 +465,8 @@ corresponding <code>Error</code>s. (optional)</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TLSMode Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset="utf-8">
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
<script src="../../js/lunr.min.js" defer></script>
|
||||
<script src="../../js/typeahead.jquery.js" defer></script>
|
||||
<script src="../../js/jazzy.search.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Enum/TLSMode" class="dashAnchor"></a>
|
||||
|
||||
<a title="TLSMode Enumeration Reference"></a>
|
||||
|
||||
<header class="header">
|
||||
<p class="header-col header-col--primary">
|
||||
<a class="header-link" href="../../index.html">
|
||||
SwiftSMTP Docs
|
||||
</a>
|
||||
(100% documented)
|
||||
</p>
|
||||
|
||||
<p class="header-col--secondary">
|
||||
<form role="search" action="../../search.json">
|
||||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</header>
|
||||
|
||||
<p class="breadcrumbs">
|
||||
<a class="breadcrumb" href="../../index.html">SwiftSMTP Reference</a>
|
||||
<img class="carat" src="../../img/carat.png" />
|
||||
TLSMode Enumeration Reference
|
||||
</p>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<nav class="navigation">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/AuthMethod.html">AuthMethod</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Enums/SMTPError.html">SMTPError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Structs.html">Structures</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Attachment.html">Attachment</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Mail.html">Mail</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/Mail/User.html">– User</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a class="nav-group-name-link" href="../../Typealiases.html">Type Aliases</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:9SwiftSMTP10Completiona">Completion</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:9SwiftSMTP8Progressa">Progress</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content top-matter">
|
||||
<h1>TLSMode</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">TLSMode</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>TLSMode enum for what form of connection security to enforce.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO6normalyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/normal" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO6normalyA2EmF">normal</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Upgrades the connection to TLS if STARTLS command is received, else sends mail without security.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">normal</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO9ignoreTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ignoreTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO9ignoreTLSyA2EmF">ignoreTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Send mail over plaintext and ignore STARTTLS commands and TLS options. Could throw an error if server requires TLS.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">ignoreTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO10requireTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requireTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO10requireTLSyA2EmF">requireTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Only send mail after an initial successful TLS connection. Connection will fail if a TLS connection cannot be established. The default port, 587, will likely need to be adjusted depending on your server.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requireTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP0B0V7TLSModeO15requireSTARTTLSyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/requireSTARTTLS" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP0B0V7TLSModeO15requireSTARTTLSyA2EmF">requireSTARTTLS</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Expect a STARTTLS command from the server and require the connection is upgraded to TLS. Will throw if the server does not issue a STARTTLS command.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">requireSTARTTLS</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
+35
-19
@@ -33,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="../img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -76,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -97,15 +100,16 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>TLSConfiguration</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TLSConfiguration</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/IBM-Swift/BlueSSLService">https://github.com/IBM-Swift/BlueSSLService</a>.</p>
|
||||
<p>Configuration for connecting with TLS. For more info, see <a href="https://github.com/Kitura/BlueSSLService">https://github.com/Kitura/BlueSSLService</a>.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@@ -117,9 +121,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg15withCipherSuite_Sb34clientAllowsSelfSignedCertificatestcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV15withCipherSuite34clientAllowsSelfSignedCertificatesACSSSg_Sbtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCipherSuite:clientAllowsSelfSignedCertificates:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg15withCipherSuite_Sb34clientAllowsSelfSignedCertificatestcfc">init(withCipherSuite:clientAllowsSelfSignedCertificates:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV15withCipherSuite34clientAllowsSelfSignedCertificatesACSSSg_Sbtcfc">init(withCipherSuite:<wbr>clientAllowsSelfSignedCertificates:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -134,7 +138,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCipherSuite</span> <span class="nv">cipherSuite</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCipherSuite</span> <span class="nv">cipherSuite</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">clientAllowsSelfSignedCertificates</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
@@ -176,9 +180,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg25withCACertificateFilePath_AD016usingCertificateF0AD0d3KeyF0Sb0H15SelfSignedCertsAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV25withCACertificateFilePath016usingCertificateF00d3KeyF00H15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCACertificateFilePath:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg25withCACertificateFilePath_AD016usingCertificateF0AD0d3KeyF0Sb0H15SelfSignedCertsAD11cipherSuitetcfc">init(withCACertificateFilePath:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV25withCACertificateFilePath016usingCertificateF00d3KeyF00H15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc">init(withCACertificateFilePath:<wbr>usingCertificateFile:<wbr>withKeyFile:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -193,7 +197,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateFilePath</span> <span class="nv">caCertificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateFilePath</span> <span class="nv">caCertificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">usingCertificateFile</span> <span class="nv">certificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withKeyFile</span> <span class="nv">keyFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
@@ -274,9 +278,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg26withCACertificateDirectory_AD20usingCertificateFileAD0d3KeyI0Sb0G15SelfSignedCertsAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV26withCACertificateDirectory20usingCertificateFile0d3KeyI00G15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withCACertificateDirectory:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg26withCACertificateDirectory_AD20usingCertificateFileAD0d3KeyI0Sb0G15SelfSignedCertsAD11cipherSuitetcfc">init(withCACertificateDirectory:usingCertificateFile:withKeyFile:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV26withCACertificateDirectory20usingCertificateFile0d3KeyI00G15SelfSignedCerts11cipherSuiteACSSSg_A2ISbAItcfc">init(withCACertificateDirectory:<wbr>usingCertificateFile:<wbr>withKeyFile:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -293,7 +297,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateDirectory</span> <span class="nv">caCertificateDirPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withCACertificateDirectory</span> <span class="nv">caCertificateDirPath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">usingCertificateFile</span> <span class="nv">certificateFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withKeyFile</span> <span class="nv">keyFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
@@ -374,9 +378,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationVACSSSg17withChainFilePath_AD0D8PasswordSb20usingSelfSignedCertsSb012clientAllowsjK12CertificatesAD11cipherSuitetcfc"></a>
|
||||
<a name="/s:9SwiftSMTP16TLSConfigurationV17withChainFilePath0D8Password20usingSelfSignedCerts012clientAllowsjK12Certificates11cipherSuiteACSSSg_AIS2bAItcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withChainFilePath:withPassword:usingSelfSignedCerts:clientAllowsSelfSignedCertificates:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationVACSSSg17withChainFilePath_AD0D8PasswordSb20usingSelfSignedCertsSb012clientAllowsjK12CertificatesAD11cipherSuitetcfc">init(withChainFilePath:withPassword:usingSelfSignedCerts:clientAllowsSelfSignedCertificates:cipherSuite:)</a>
|
||||
<a class="token" href="#/s:9SwiftSMTP16TLSConfigurationV17withChainFilePath0D8Password20usingSelfSignedCerts012clientAllowsjK12Certificates11cipherSuiteACSSSg_AIS2bAItcfc">init(withChainFilePath:<wbr>withPassword:<wbr>usingSelfSignedCerts:<wbr>clientAllowsSelfSignedCertificates:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -393,7 +397,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withChainFilePath</span> <span class="nv">chainFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">withChainFilePath</span> <span class="nv">chainFilePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span>
|
||||
<span class="n">withPassword</span> <span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="n">usingSelfSignedCerts</span> <span class="nv">selfSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">clientAllowsSelfSignedCertificates</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
|
||||
@@ -441,6 +445,18 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>clientAllowsSelfSignedCertificates</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>True if, as a client, connections to self-signed servers are allowed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
@@ -464,7 +480,7 @@
|
||||
<code>
|
||||
<a name="/"></a>
|
||||
<a name="//apple_ref/swift/Method/init(withPEMCertificateString:usingSelfSignedCerts:cipherSuite:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/">init(withPEMCertificateString:usingSelfSignedCerts:cipherSuite:)</a>
|
||||
<a class="token" href="#/">init(withPEMCertificateString:<wbr>usingSelfSignedCerts:<wbr>cipherSuite:<wbr>)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -486,8 +502,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="//apple_ref/swift/Section/Type Aliases" class="dashAnchor"></a>
|
||||
|
||||
<a title="Type Aliases Reference"></a>
|
||||
|
||||
@@ -32,7 +33,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +76,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,7 +100,7 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
<h1>Type Aliases</h1>
|
||||
<p>The following type aliases are available globally.</p>
|
||||
|
||||
@@ -127,7 +131,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Progress</span> <span class="o">=</span> <span class="p">((</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Progress</span> <span class="o">=</span> <span class="p">((</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,7 +159,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Completion</span> <span class="o">=</span> <span class="p">(([</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">],</span> <span class="p">[(</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">)])</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Completion</span> <span class="o">=</span> <span class="p">(([</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">],</span> <span class="p">[(</span><span class="kt"><a href="Structs/Mail.html">Mail</a></span><span class="p">,</span> <span class="kt">Error</span><span class="p">)])</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,8 +174,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -63,6 +63,10 @@ a {
|
||||
a:hover, a:focus {
|
||||
outline: 0;
|
||||
text-decoration: underline; }
|
||||
a.discouraged {
|
||||
text-decoration: line-through; }
|
||||
a.discouraged:hover, a.discouraged:focus {
|
||||
text-decoration: underline line-through; }
|
||||
|
||||
table {
|
||||
background: #fff;
|
||||
@@ -90,10 +94,10 @@ pre {
|
||||
code {
|
||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
|
||||
|
||||
p > code, li > code {
|
||||
.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code {
|
||||
background: #f7f7f7;
|
||||
padding: .2em; }
|
||||
p > code:before, p > code:after, li > code:before, li > code:after {
|
||||
.item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after {
|
||||
letter-spacing: -.2em;
|
||||
content: "\00a0"; }
|
||||
|
||||
@@ -107,7 +111,6 @@ pre code {
|
||||
@media (min-width: 768px) {
|
||||
.content-wrapper {
|
||||
flex-direction: row; } }
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
padding: 8px;
|
||||
@@ -153,7 +156,6 @@ pre code {
|
||||
word-wrap: normal;
|
||||
background: #fbfbfb;
|
||||
border-right: 1px solid #ddd; } }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
padding-left: 0; }
|
||||
@@ -184,7 +186,6 @@ pre code {
|
||||
order: 2;
|
||||
flex: 1;
|
||||
padding-bottom: 60px; } }
|
||||
|
||||
.section {
|
||||
padding: 0 32px;
|
||||
border-bottom: 1px solid #ddd; }
|
||||
@@ -197,6 +198,8 @@ pre code {
|
||||
.section-name {
|
||||
color: #666;
|
||||
display: block; }
|
||||
.section-name p {
|
||||
margin-bottom: inherit; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
@@ -215,6 +218,22 @@ pre code {
|
||||
content: "";
|
||||
display: block; }
|
||||
|
||||
.section-name-container {
|
||||
position: relative; }
|
||||
.section-name-container .section-name-link {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin-bottom: 0; }
|
||||
.section-name-container .section-name {
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
z-index: 1; }
|
||||
.section-name-container .section-name a {
|
||||
pointer-events: auto; }
|
||||
|
||||
.item-container {
|
||||
padding: 0; }
|
||||
|
||||
@@ -225,9 +244,11 @@ pre code {
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block; }
|
||||
.item .token {
|
||||
.item .token, .item .direct-link {
|
||||
display: inline-block;
|
||||
text-indent: -20px;
|
||||
padding-left: 3px;
|
||||
margin-left: 0px;
|
||||
margin-left: 20px;
|
||||
font-size: 1rem; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
@@ -287,9 +308,9 @@ pre code {
|
||||
.language .aside-title {
|
||||
color: #4183c4; }
|
||||
|
||||
.aside-warning {
|
||||
.aside-warning, .aside-deprecated, .aside-unavailable {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
.aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
@@ -325,6 +346,7 @@ pre code {
|
||||
|
||||
html.dash .header, html.dash .breadcrumbs, html.dash .navigation {
|
||||
display: none; }
|
||||
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
|
||||
@@ -338,14 +360,17 @@ form[role=search] input {
|
||||
border-radius: 1em; }
|
||||
.loading form[role=search] input {
|
||||
background: white url(../img/spinner.gif) center right 4px no-repeat; }
|
||||
|
||||
form[role=search] .tt-menu {
|
||||
margin: 0;
|
||||
min-width: 300px;
|
||||
background: #fbfbfb;
|
||||
color: #333;
|
||||
border: 1px solid #ddd; }
|
||||
|
||||
form[role=search] .tt-highlight {
|
||||
font-weight: bold; }
|
||||
|
||||
form[role=search] .tt-suggestion {
|
||||
font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
padding: 0 8px; }
|
||||
@@ -358,11 +383,13 @@ form[role=search] .tt-suggestion {
|
||||
font-weight: normal;
|
||||
font-size: 0.9em;
|
||||
padding-left: 16px; }
|
||||
|
||||
form[role=search] .tt-suggestion:hover,
|
||||
form[role=search] .tt-suggestion.tt-cursor {
|
||||
cursor: pointer;
|
||||
background-color: #4183c4;
|
||||
color: #fff; }
|
||||
|
||||
form[role=search] .tt-suggestion:hover .doc-parent-name,
|
||||
form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
|
||||
color: #fff; }
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +75,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,15 +99,15 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
|
||||
<h1 id='swift-smtp' class='heading'>Swift-SMTP</h1>
|
||||
|
||||
<p><img src="https://github.com/IBM-Swift/Swift-SMTP/blob/master/Assets/swift-smtp-bird.png?raw=true" alt="Swift-SMTP bird"></p>
|
||||
<p><img src="https://github.com/Kitura/Swift-SMTP/blob/master/Assets/swift-smtp-bird.png?raw=true" alt="Swift-SMTP bird"></p>
|
||||
|
||||
<p>Swift SMTP client.</p>
|
||||
|
||||
<p><img src="https://travis-ci.org/IBM-Swift/Swift-SMTP.svg?branch=master" alt="Build Status">
|
||||
<p><img src="https://travis-ci.org/Kitura/Swift-SMTP.svg?branch=master" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/os-macOS-green.svg?style=flat" alt="macOS">
|
||||
<img src="https://img.shields.io/badge/os-linux-green.svg?style=flat" alt="Linux">
|
||||
<img src="https://img.shields.io/badge/license-Apache2-blue.svg?style=flat" alt="Apache 2"></p>
|
||||
@@ -115,14 +118,43 @@
|
||||
<li>Authenticate with CRAM-MD5, LOGIN, PLAIN, or XOAUTH2</li>
|
||||
<li>Send emails with local file, HTML, and raw data attachments</li>
|
||||
<li>Add custom headers</li>
|
||||
<li><a href="https://ibm-swift.github.io/Swift-SMTP/">Documentation</a></li>
|
||||
<li><a href="https://kitura.github.io/Swift-SMTP/">Documentation</a></li>
|
||||
</ul>
|
||||
<h2 id='swift-version' class='heading'>Swift Version</h2>
|
||||
|
||||
<p>macOS & Linux: <code>Swift 4.0.3</code> or <code>Swift 4.1</code></p>
|
||||
<p>macOS & Linux: <code>Swift 4.0.3</code>, <code>Swift 4.1</code> and <code>Swift 4.1.2</code></p>
|
||||
<h2 id='installation' class='heading'>Installation</h2>
|
||||
|
||||
<p>You can add <code>SwiftSMTP</code> to your project using <a href="https://swift.org/package-manager/">Swift Package Manager</a>. If your project does not have a <code>Package.swift</code> file, create one by running <code>swift package init</code> in the root directory of your project. Then open <code>Package.swift</code> and add <code>SwiftSMTP</code> as a dependency. Be sure to add it to your desired targets as well:</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// swift-tools-version:4.0</span>
|
||||
|
||||
<span class="kd">import</span> <span class="kt">PackageDescription</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">package</span> <span class="o">=</span> <span class="kt">Package</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">products</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">library</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">targets</span><span class="p">:</span> <span class="p">[</span><span class="s">"MyProject"</span><span class="p">]),</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">package</span><span class="p">(</span><span class="nv">url</span><span class="p">:</span> <span class="s">"https://github.com/Kitura/Swift-SMTP"</span><span class="p">,</span> <span class="o">.</span><span class="nf">upToNextMinor</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="s">"5.1.0"</span><span class="p">)),</span> <span class="c1">// add the dependency</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">targets</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">target</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span><span class="s">"SwiftSMTP"</span><span class="p">]),</span> <span class="c1">// add targets</span>
|
||||
<span class="o">.</span><span class="nf">testTarget</span><span class="p">(</span> <span class="c1">// note "SwiftSMTP" (NO HYPHEN)</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProjectTests"</span><span class="p">,</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span><span class="s">"MyProject"</span><span class="p">]),</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>After adding the dependency and saving, run <code>swift package generate-xcodeproj</code> in the root directory of your project. This will fetch dependencies and create an Xcode project which you can open and begin editing.</p>
|
||||
<h2 id='migration-guide' class='heading'>Migration Guide</h2>
|
||||
|
||||
<p>Version <code>4.0.0</code> & <code>3.0.0</code> bring breaking changes. See the quick migration guide <a href="https://github.com/IBM-Swift/Swift-SMTP/blob/master/migration-guide.md">here</a>.</p>
|
||||
<p>Version <code>5.0.0</code> brings breaking changes. See the quick migration guide <a href="https://github.com/Kitura/Swift-SMTP/blob/master/migration-guide.md">here</a>.</p>
|
||||
<h2 id='usage' class='heading'>Usage</h2>
|
||||
|
||||
<p>Initialize an <code><a href="Structs/SMTP.html">SMTP</a></code> instance:</p>
|
||||
@@ -140,15 +172,15 @@
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">465</span><span class="p">,</span>
|
||||
<span class="nv">useTLS</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">587</span><span class="p">,</span>
|
||||
<span class="nv">tlsMode</span><span class="p">:</span> <span class="kt">TLSMode</span> <span class="o">=</span> <span class="o">.</span><span class="n">requireSTARTTLS</span><span class="p">,</span>
|
||||
<span class="nv">tlsConfiguration</span><span class="p">:</span> <span class="kt">TLSConfiguration</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">authMethods</span><span class="p">:</span> <span class="p">[</span><span class="kt">AuthMethod</span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">domainName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"localhost"</span><span class="p">,</span>
|
||||
<span class="nv">timeout</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>By default, the <code><a href="Structs/SMTP.html">SMTP</a></code> struct connects on port <code>465</code> and tries to connect using TLS. It also uses a <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code> that uses no backing certificates. Configure these to your needs. For more info on <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code>, view the <a href="https://ibm-swift.github.io/Swift-SMTP/Structs/TLSConfiguration.html">docs</a>.</p>
|
||||
<p>By default, the <code><a href="Structs/SMTP.html">SMTP</a></code> struct connects on port <code>587</code> and sends mail only if a TLS connection can be established. It also uses a <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code> that uses no backing certificates. View the <a href="https://kitura.github.io/Swift-SMTP/">docs</a> for more configuration options.</p>
|
||||
<h3 id='send-email' class='heading'>Send email</h3>
|
||||
|
||||
<p>Create a <code><a href="Structs/Mail.html">Mail</a></code> object and use your <code><a href="Structs/SMTP.html">SMTP</a></code> handle to send it. To set the sender and receiver of an email, use the <code>User</code> struct:</p>
|
||||
@@ -256,8 +288,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
@@ -8,26 +8,41 @@ if (navigator.userAgent.match(/xcode/i)) {
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
function toggleItem($link, $content) {
|
||||
var animationDuration = 300;
|
||||
$link.toggleClass('token-open');
|
||||
$content.slideToggle(animationDuration);
|
||||
}
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
function itemLinkToContent($link) {
|
||||
return $link.parent().parent().next();
|
||||
}
|
||||
|
||||
// On doc load + hash-change, open any targetted item
|
||||
function openCurrentItemIfClosed() {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
|
||||
$content = itemLinkToContent($link);
|
||||
if ($content.is(':hidden')) {
|
||||
toggleItem($link, $content);
|
||||
}
|
||||
}
|
||||
|
||||
$(openCurrentItemIfClosed);
|
||||
$(window).on('hashchange', openCurrentItemIfClosed);
|
||||
|
||||
// On item link ('token') click, toggle its discussion
|
||||
$('.token').on('click', function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var $link = $(this);
|
||||
toggleItem($link, itemLinkToContent($link));
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
var href = $link.attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
@@ -36,8 +51,20 @@ $(".token").click(function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Dumb down quotes within code blocks that delimit strings instead of quotations
|
||||
// https://github.com/realm/jazzy/issues/714
|
||||
$("code q").replaceWith(function () {
|
||||
return ["\"", $(this).contents(), "\""];
|
||||
// Clicks on links to the current, closed, item need to open the item
|
||||
$("a:not('.token')").on('click', function() {
|
||||
if (location == this.href) {
|
||||
openCurrentItemIfClosed();
|
||||
}
|
||||
});
|
||||
|
||||
// KaTeX rendering
|
||||
if ("katex" in window) {
|
||||
$($('.math').each( (_, element) => {
|
||||
katex.render(element.textContent, element, {
|
||||
displayMode: $(element).hasClass('m-block'),
|
||||
throwOnError: false,
|
||||
trust: true
|
||||
});
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
$(function(){
|
||||
var searchIndex = lunr(function() {
|
||||
this.ref('url');
|
||||
this.field('name');
|
||||
});
|
||||
|
||||
var $typeahead = $('[data-typeahead]');
|
||||
var $form = $typeahead.parents('form');
|
||||
var searchURL = $form.attr('action');
|
||||
@@ -26,21 +21,34 @@ $(function(){
|
||||
$form.addClass('loading');
|
||||
|
||||
$.getJSON(searchURL).then(function(searchData) {
|
||||
$.each(searchData, function (url, doc) {
|
||||
searchIndex.add({url: url, name: doc.name});
|
||||
const searchIndex = lunr(function() {
|
||||
this.ref('url');
|
||||
this.field('name');
|
||||
this.field('abstract');
|
||||
for (const [url, doc] of Object.entries(searchData)) {
|
||||
this.add({url: url, name: doc.name, abstract: doc.abstract});
|
||||
}
|
||||
});
|
||||
|
||||
$typeahead.typeahead(
|
||||
{
|
||||
highlight: true,
|
||||
minLength: 3
|
||||
minLength: 3,
|
||||
autoselect: true
|
||||
},
|
||||
{
|
||||
limit: 10,
|
||||
display: displayTemplate,
|
||||
templates: { suggestion: suggestionTemplate },
|
||||
source: function(query, sync) {
|
||||
var results = searchIndex.search(query).map(function(result) {
|
||||
const lcSearch = query.toLowerCase();
|
||||
const results = searchIndex.query(function(q) {
|
||||
q.term(lcSearch, { boost: 100 });
|
||||
q.term(lcSearch, {
|
||||
boost: 10,
|
||||
wildcard: lunr.Query.wildcard.TRAILING
|
||||
});
|
||||
}).map(function(result) {
|
||||
var doc = searchData[result.ref];
|
||||
doc.url = result.ref;
|
||||
return doc;
|
||||
|
||||
Vendored
Executable → Regular
+2
-4
File diff suppressed because one or more lines are too long
Vendored
Executable → Regular
+3
-3
File diff suppressed because one or more lines are too long
+209
-53
@@ -1,18 +1,19 @@
|
||||
/*!
|
||||
* typeahead.js 0.11.1
|
||||
* https://github.com/twitter/typeahead.js
|
||||
* Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
|
||||
* typeahead.js 1.3.1
|
||||
* https://github.com/corejavascript/typeahead.js
|
||||
* Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("typeahead.js", [ "jquery" ], function(a0) {
|
||||
define([ "jquery" ], function(a0) {
|
||||
return factory(a0);
|
||||
});
|
||||
} else if (typeof exports === "object") {
|
||||
} else if (typeof module === "object" && module.exports) {
|
||||
module.exports = factory(require("jquery"));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
})(this, function($) {
|
||||
var _ = function() {
|
||||
@@ -148,6 +149,13 @@
|
||||
stringify: function(val) {
|
||||
return _.isString(val) ? val : JSON.stringify(val);
|
||||
},
|
||||
guid: function() {
|
||||
function _p8(s) {
|
||||
var p = (Math.random().toString(16) + "000000000").substr(2, 8);
|
||||
return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
|
||||
}
|
||||
return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
|
||||
},
|
||||
noop: function() {}
|
||||
};
|
||||
}();
|
||||
@@ -189,7 +197,7 @@
|
||||
function buildHtml(c) {
|
||||
return {
|
||||
wrapper: '<span class="' + c.wrapper + '"></span>',
|
||||
menu: '<div class="' + c.menu + '"></div>'
|
||||
menu: '<div role="listbox" class="' + c.menu + '"></div>'
|
||||
};
|
||||
}
|
||||
function buildSelectors(classes) {
|
||||
@@ -264,10 +272,8 @@
|
||||
}
|
||||
_.mixin(EventBus.prototype, {
|
||||
_trigger: function(type, args) {
|
||||
var $e;
|
||||
$e = $.Event(namespace + type);
|
||||
(args = args || []).unshift($e);
|
||||
this.$el.trigger.apply(this.$el, args);
|
||||
var $e = $.Event(namespace + type);
|
||||
this.$el.trigger.call(this.$el, $e, args || []);
|
||||
return $e;
|
||||
},
|
||||
before: function(type) {
|
||||
@@ -384,7 +390,36 @@
|
||||
tagName: "strong",
|
||||
className: null,
|
||||
wordsOnly: false,
|
||||
caseSensitive: false
|
||||
caseSensitive: false,
|
||||
diacriticInsensitive: false
|
||||
};
|
||||
var accented = {
|
||||
A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",
|
||||
B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",
|
||||
C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",
|
||||
D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",
|
||||
E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",
|
||||
F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",
|
||||
G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",
|
||||
H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",
|
||||
I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",
|
||||
J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",
|
||||
K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",
|
||||
L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",
|
||||
M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",
|
||||
N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",
|
||||
O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",
|
||||
P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",
|
||||
Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]",
|
||||
R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",
|
||||
S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",
|
||||
T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",
|
||||
U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",
|
||||
V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",
|
||||
W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",
|
||||
X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",
|
||||
Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",
|
||||
Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"
|
||||
};
|
||||
return function hightlight(o) {
|
||||
var regex;
|
||||
@@ -393,7 +428,7 @@
|
||||
return;
|
||||
}
|
||||
o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ];
|
||||
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
|
||||
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive);
|
||||
traverse(o.node, hightlightTextNode);
|
||||
function hightlightTextNode(textNode) {
|
||||
var match, patternNode, wrapperNode;
|
||||
@@ -419,10 +454,17 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
function getRegex(patterns, caseSensitive, wordsOnly) {
|
||||
function accent_replacer(chr) {
|
||||
return accented[chr.toUpperCase()] || chr;
|
||||
}
|
||||
function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) {
|
||||
var escapedPatterns = [], regexStr;
|
||||
for (var i = 0, len = patterns.length; i < len; i++) {
|
||||
escapedPatterns.push(_.escapeRegExChars(patterns[i]));
|
||||
var escapedWord = _.escapeRegExChars(patterns[i]);
|
||||
if (diacriticInsensitive) {
|
||||
escapedWord = escapedWord.replace(/\S/g, accent_replacer);
|
||||
}
|
||||
escapedPatterns.push(escapedWord);
|
||||
}
|
||||
regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
|
||||
return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
|
||||
@@ -441,6 +483,7 @@
|
||||
40: "down"
|
||||
};
|
||||
function Input(o, www) {
|
||||
var id;
|
||||
o = o || {};
|
||||
if (!o.input) {
|
||||
$.error("input is missing");
|
||||
@@ -448,6 +491,18 @@
|
||||
www.mixin(this);
|
||||
this.$hint = $(o.hint);
|
||||
this.$input = $(o.input);
|
||||
this.$menu = $(o.menu);
|
||||
id = this.$input.attr("id") || _.guid();
|
||||
this.$menu.attr("id", id + "_listbox");
|
||||
this.$hint.attr({
|
||||
"aria-hidden": true
|
||||
});
|
||||
this.$input.attr({
|
||||
"aria-owns": id + "_listbox",
|
||||
role: "combobox",
|
||||
"aria-autocomplete": "list",
|
||||
"aria-expanded": false
|
||||
});
|
||||
this.query = this.$input.val();
|
||||
this.queryWhenFocused = this.hasFocus() ? this.query : null;
|
||||
this.$overflowHelper = buildOverflowHelper(this.$input);
|
||||
@@ -455,6 +510,7 @@
|
||||
if (this.$hint.length === 0) {
|
||||
this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
|
||||
}
|
||||
this.onSync("cursorchange", this._updateDescendent);
|
||||
}
|
||||
Input.normalizeQuery = function(str) {
|
||||
return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
|
||||
@@ -524,6 +580,9 @@
|
||||
this.trigger("whitespaceChanged", this.query);
|
||||
}
|
||||
},
|
||||
_updateDescendent: function updateDescendent(event, id) {
|
||||
this.$input.attr("aria-activedescendant", id);
|
||||
},
|
||||
bind: function() {
|
||||
var that = this, onBlur, onFocus, onKeydown, onInput;
|
||||
onBlur = _.bind(this._onBlur, this);
|
||||
@@ -616,6 +675,9 @@
|
||||
this.$input.off(".tt");
|
||||
this.$overflowHelper.remove();
|
||||
this.$hint = this.$input = this.$overflowHelper = $("<div>");
|
||||
},
|
||||
setAriaExpanded: function setAriaExpanded(value) {
|
||||
this.$input.attr("aria-expanded", value);
|
||||
}
|
||||
});
|
||||
return Input;
|
||||
@@ -647,6 +709,7 @@
|
||||
"use strict";
|
||||
var keys, nameGenerator;
|
||||
keys = {
|
||||
dataset: "tt-selectable-dataset",
|
||||
val: "tt-selectable-display",
|
||||
obj: "tt-selectable-object"
|
||||
};
|
||||
@@ -666,19 +729,20 @@
|
||||
}
|
||||
www.mixin(this);
|
||||
this.highlight = !!o.highlight;
|
||||
this.name = o.name || nameGenerator();
|
||||
this.name = _.toStr(o.name || nameGenerator());
|
||||
this.limit = o.limit || 5;
|
||||
this.displayFn = getDisplayFn(o.display || o.displayKey);
|
||||
this.templates = getTemplates(o.templates, this.displayFn);
|
||||
this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
|
||||
this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
|
||||
this._resetLastSuggestion();
|
||||
this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
|
||||
this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
|
||||
}
|
||||
Dataset.extractData = function extractData(el) {
|
||||
var $el = $(el);
|
||||
if ($el.data(keys.obj)) {
|
||||
return {
|
||||
dataset: $el.data(keys.dataset) || "",
|
||||
val: $el.data(keys.val) || "",
|
||||
obj: $el.data(keys.obj) || null
|
||||
};
|
||||
@@ -697,7 +761,7 @@
|
||||
} else {
|
||||
this._empty();
|
||||
}
|
||||
this.trigger("rendered", this.name, suggestions, false);
|
||||
this.trigger("rendered", suggestions, false, this.name);
|
||||
},
|
||||
_append: function append(query, suggestions) {
|
||||
suggestions = suggestions || [];
|
||||
@@ -708,7 +772,7 @@
|
||||
} else if (!this.$lastSuggestion.length && this.templates.notFound) {
|
||||
this._renderNotFound(query);
|
||||
}
|
||||
this.trigger("rendered", this.name, suggestions, true);
|
||||
this.trigger("rendered", suggestions, true, this.name);
|
||||
},
|
||||
_renderSuggestions: function renderSuggestions(query, suggestions) {
|
||||
var $fragment;
|
||||
@@ -749,7 +813,7 @@
|
||||
_.each(suggestions, function getSuggestionNode(suggestion) {
|
||||
var $el, context;
|
||||
context = that._injectQuery(query, suggestion);
|
||||
$el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
|
||||
$el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
|
||||
fragment.appendChild($el[0]);
|
||||
});
|
||||
this.highlight && highlight({
|
||||
@@ -787,7 +851,7 @@
|
||||
this.cancel = function cancel() {
|
||||
canceled = true;
|
||||
that.cancel = $.noop;
|
||||
that.async && that.trigger("asyncCanceled", query);
|
||||
that.async && that.trigger("asyncCanceled", query, that.name);
|
||||
};
|
||||
this.source(query, sync, async);
|
||||
!syncCalled && sync([]);
|
||||
@@ -800,16 +864,17 @@
|
||||
rendered = suggestions.length;
|
||||
that._overwrite(query, suggestions);
|
||||
if (rendered < that.limit && that.async) {
|
||||
that.trigger("asyncRequested", query);
|
||||
that.trigger("asyncRequested", query, that.name);
|
||||
}
|
||||
}
|
||||
function async(suggestions) {
|
||||
suggestions = suggestions || [];
|
||||
if (!canceled && rendered < that.limit) {
|
||||
that.cancel = $.noop;
|
||||
rendered += suggestions.length;
|
||||
that._append(query, suggestions.slice(0, that.limit - rendered));
|
||||
that.async && that.trigger("asyncReceived", query);
|
||||
var idx = Math.abs(rendered - that.limit);
|
||||
rendered += idx;
|
||||
that._append(query, suggestions.slice(0, idx));
|
||||
that.async && that.trigger("asyncReceived", query, that.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -840,10 +905,14 @@
|
||||
pending: templates.pending && _.templatify(templates.pending),
|
||||
header: templates.header && _.templatify(templates.header),
|
||||
footer: templates.footer && _.templatify(templates.footer),
|
||||
suggestion: templates.suggestion || suggestionTemplate
|
||||
suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate
|
||||
};
|
||||
function userSuggestionTemplate(context) {
|
||||
var template = templates.suggestion;
|
||||
return $(template(context)).attr("id", _.guid());
|
||||
}
|
||||
function suggestionTemplate(context) {
|
||||
return $("<div>").text(displayFn(context));
|
||||
return $('<div role="option">').attr("id", _.guid()).text(displayFn(context));
|
||||
}
|
||||
}
|
||||
function isValidName(str) {
|
||||
@@ -884,10 +953,11 @@
|
||||
this.trigger.apply(this, arguments);
|
||||
},
|
||||
_allDatasetsEmpty: function allDatasetsEmpty() {
|
||||
return _.every(this.datasets, isDatasetEmpty);
|
||||
function isDatasetEmpty(dataset) {
|
||||
return dataset.isEmpty();
|
||||
}
|
||||
return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) {
|
||||
var isEmpty = dataset.isEmpty();
|
||||
this.$node.attr("aria-expanded", !isEmpty);
|
||||
return isEmpty;
|
||||
}, this));
|
||||
},
|
||||
_getSelectables: function getSelectables() {
|
||||
return this.$node.find(this.selectors.selectable);
|
||||
@@ -912,6 +982,12 @@
|
||||
var that = this, onSelectableClick;
|
||||
onSelectableClick = _.bind(this._onSelectableClick, this);
|
||||
this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
|
||||
this.$node.on("mouseover", this.selectors.selectable, function() {
|
||||
that.setCursor($(this));
|
||||
});
|
||||
this.$node.on("mouseleave", function() {
|
||||
that._removeCursor();
|
||||
});
|
||||
_.each(this.datasets, function(dataset) {
|
||||
dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
|
||||
});
|
||||
@@ -921,9 +997,11 @@
|
||||
return this.$node.hasClass(this.classes.open);
|
||||
},
|
||||
open: function open() {
|
||||
this.$node.scrollTop(0);
|
||||
this.$node.addClass(this.classes.open);
|
||||
},
|
||||
close: function close() {
|
||||
this.$node.attr("aria-expanded", false);
|
||||
this.$node.removeClass(this.classes.open);
|
||||
this._removeCursor();
|
||||
},
|
||||
@@ -988,6 +1066,55 @@
|
||||
});
|
||||
return Menu;
|
||||
}();
|
||||
var Status = function() {
|
||||
"use strict";
|
||||
function Status(options) {
|
||||
this.$el = $("<span></span>", {
|
||||
role: "status",
|
||||
"aria-live": "polite"
|
||||
}).css({
|
||||
position: "absolute",
|
||||
padding: "0",
|
||||
border: "0",
|
||||
height: "1px",
|
||||
width: "1px",
|
||||
"margin-bottom": "-1px",
|
||||
"margin-right": "-1px",
|
||||
overflow: "hidden",
|
||||
clip: "rect(0 0 0 0)",
|
||||
"white-space": "nowrap"
|
||||
});
|
||||
options.$input.after(this.$el);
|
||||
_.each(options.menu.datasets, _.bind(function(dataset) {
|
||||
if (dataset.onSync) {
|
||||
dataset.onSync("rendered", _.bind(this.update, this));
|
||||
dataset.onSync("cleared", _.bind(this.cleared, this));
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
_.mixin(Status.prototype, {
|
||||
update: function update(event, suggestions) {
|
||||
var length = suggestions.length;
|
||||
var words;
|
||||
if (length === 1) {
|
||||
words = {
|
||||
result: "result",
|
||||
is: "is"
|
||||
};
|
||||
} else {
|
||||
words = {
|
||||
result: "results",
|
||||
is: "are"
|
||||
};
|
||||
}
|
||||
this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate.");
|
||||
},
|
||||
cleared: function() {
|
||||
this.$el.text("");
|
||||
}
|
||||
});
|
||||
return Status;
|
||||
}();
|
||||
var DefaultMenu = function() {
|
||||
"use strict";
|
||||
var s = Menu.prototype;
|
||||
@@ -1052,6 +1179,7 @@
|
||||
this.input = o.input;
|
||||
this.menu = o.menu;
|
||||
this.enabled = true;
|
||||
this.autoselect = !!o.autoselect;
|
||||
this.active = false;
|
||||
this.input.hasFocus() && this.activate();
|
||||
this.dir = this.input.getLangDir();
|
||||
@@ -1098,8 +1226,12 @@
|
||||
_onDatasetCleared: function onDatasetCleared() {
|
||||
this._updateHint();
|
||||
},
|
||||
_onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) {
|
||||
_onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
|
||||
this._updateHint();
|
||||
if (this.autoselect) {
|
||||
var cursorClass = this.selectors.cursor.substr(1);
|
||||
this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
|
||||
}
|
||||
this.eventBus.trigger("render", suggestions, async, dataset);
|
||||
},
|
||||
_onAsyncRequested: function onAsyncRequested(type, dataset, query) {
|
||||
@@ -1122,15 +1254,25 @@
|
||||
_onEnterKeyed: function onEnterKeyed(type, $e) {
|
||||
var $selectable;
|
||||
if ($selectable = this.menu.getActiveSelectable()) {
|
||||
this.select($selectable) && $e.preventDefault();
|
||||
if (this.select($selectable)) {
|
||||
$e.preventDefault();
|
||||
$e.stopPropagation();
|
||||
}
|
||||
} else if (this.autoselect) {
|
||||
if (this.select(this.menu.getTopSelectable())) {
|
||||
$e.preventDefault();
|
||||
$e.stopPropagation();
|
||||
}
|
||||
}
|
||||
},
|
||||
_onTabKeyed: function onTabKeyed(type, $e) {
|
||||
var $selectable;
|
||||
if ($selectable = this.menu.getActiveSelectable()) {
|
||||
this.select($selectable) && $e.preventDefault();
|
||||
} else if ($selectable = this.menu.getTopSelectable()) {
|
||||
this.autocomplete($selectable) && $e.preventDefault();
|
||||
} else if (this.autoselect) {
|
||||
if ($selectable = this.menu.getTopSelectable()) {
|
||||
this.autocomplete($selectable) && $e.preventDefault();
|
||||
}
|
||||
}
|
||||
},
|
||||
_onEscKeyed: function onEscKeyed() {
|
||||
@@ -1144,12 +1286,12 @@
|
||||
},
|
||||
_onLeftKeyed: function onLeftKeyed() {
|
||||
if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
|
||||
this.autocomplete(this.menu.getTopSelectable());
|
||||
this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
|
||||
}
|
||||
},
|
||||
_onRightKeyed: function onRightKeyed() {
|
||||
if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
|
||||
this.autocomplete(this.menu.getTopSelectable());
|
||||
this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
|
||||
}
|
||||
},
|
||||
_onQueryChanged: function onQueryChanged(e, query) {
|
||||
@@ -1226,6 +1368,7 @@
|
||||
},
|
||||
open: function open() {
|
||||
if (!this.isOpen() && !this.eventBus.before("open")) {
|
||||
this.input.setAriaExpanded(true);
|
||||
this.menu.open();
|
||||
this._updateHint();
|
||||
this.eventBus.trigger("open");
|
||||
@@ -1234,6 +1377,7 @@
|
||||
},
|
||||
close: function close() {
|
||||
if (this.isOpen() && !this.eventBus.before("close")) {
|
||||
this.input.setAriaExpanded(false);
|
||||
this.menu.close();
|
||||
this.input.clearHint();
|
||||
this.input.resetInputValue();
|
||||
@@ -1249,9 +1393,9 @@
|
||||
},
|
||||
select: function select($selectable) {
|
||||
var data = this.menu.getSelectableData($selectable);
|
||||
if (data && !this.eventBus.before("select", data.obj)) {
|
||||
if (data && !this.eventBus.before("select", data.obj, data.dataset)) {
|
||||
this.input.setQuery(data.val, true);
|
||||
this.eventBus.trigger("select", data.obj);
|
||||
this.eventBus.trigger("select", data.obj, data.dataset);
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
@@ -1262,29 +1406,34 @@
|
||||
query = this.input.getQuery();
|
||||
data = this.menu.getSelectableData($selectable);
|
||||
isValid = data && query !== data.val;
|
||||
if (isValid && !this.eventBus.before("autocomplete", data.obj)) {
|
||||
if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) {
|
||||
this.input.setQuery(data.val);
|
||||
this.eventBus.trigger("autocomplete", data.obj);
|
||||
this.eventBus.trigger("autocomplete", data.obj, data.dataset);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
moveCursor: function moveCursor(delta) {
|
||||
var query, $candidate, data, payload, cancelMove;
|
||||
var query, $candidate, data, suggestion, datasetName, cancelMove, id;
|
||||
query = this.input.getQuery();
|
||||
$candidate = this.menu.selectableRelativeToCursor(delta);
|
||||
data = this.menu.getSelectableData($candidate);
|
||||
payload = data ? data.obj : null;
|
||||
suggestion = data ? data.obj : null;
|
||||
datasetName = data ? data.dataset : null;
|
||||
id = $candidate ? $candidate.attr("id") : null;
|
||||
this.input.trigger("cursorchange", id);
|
||||
cancelMove = this._minLengthMet() && this.menu.update(query);
|
||||
if (!cancelMove && !this.eventBus.before("cursorchange", payload)) {
|
||||
if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) {
|
||||
this.menu.setCursor($candidate);
|
||||
if (data) {
|
||||
this.input.setInputValue(data.val);
|
||||
if (typeof data.val === "string") {
|
||||
this.input.setInputValue(data.val);
|
||||
}
|
||||
} else {
|
||||
this.input.resetInputValue();
|
||||
this._updateHint();
|
||||
}
|
||||
this.eventBus.trigger("cursorchange", payload);
|
||||
this.eventBus.trigger("cursorchange", suggestion, datasetName);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1322,7 +1471,7 @@
|
||||
www = WWW(o.classNames);
|
||||
return this.each(attach);
|
||||
function attach() {
|
||||
var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor;
|
||||
var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor;
|
||||
_.each(datasets, function(d) {
|
||||
d.highlight = !!o.highlight;
|
||||
});
|
||||
@@ -1347,17 +1496,23 @@
|
||||
});
|
||||
input = new Input({
|
||||
hint: $hint,
|
||||
input: $input
|
||||
input: $input,
|
||||
menu: $menu
|
||||
}, www);
|
||||
menu = new MenuConstructor({
|
||||
node: $menu,
|
||||
datasets: datasets
|
||||
}, www);
|
||||
status = new Status({
|
||||
$input: $input,
|
||||
menu: menu
|
||||
});
|
||||
typeahead = new Typeahead({
|
||||
input: input,
|
||||
menu: menu,
|
||||
eventBus: eventBus,
|
||||
minLength: o.minLength
|
||||
minLength: o.minLength,
|
||||
autoselect: o.autoselect
|
||||
}, www);
|
||||
$input.data(keys.www, www);
|
||||
$input.data(keys.typeahead, typeahead);
|
||||
@@ -1450,7 +1605,7 @@
|
||||
return query;
|
||||
} else {
|
||||
ttEach(this, function(t) {
|
||||
t.setVal(newVal);
|
||||
t.setVal(_.toStr(newVal));
|
||||
});
|
||||
return this;
|
||||
}
|
||||
@@ -1481,8 +1636,10 @@
|
||||
});
|
||||
}
|
||||
function buildHintFromInput($input, www) {
|
||||
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({
|
||||
autocomplete: "off",
|
||||
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
|
||||
readonly: true,
|
||||
required: false
|
||||
}).removeAttr("id name placeholder").removeClass("required").attr({
|
||||
spellcheck: "false",
|
||||
tabindex: -1
|
||||
});
|
||||
@@ -1495,7 +1652,6 @@
|
||||
style: $input.attr("style")
|
||||
});
|
||||
$input.addClass(www.classes.input).attr({
|
||||
autocomplete: "off",
|
||||
spellcheck: false
|
||||
});
|
||||
try {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
+44
-12
@@ -32,7 +32,7 @@
|
||||
</p>
|
||||
|
||||
<p class="header-col header-col--secondary">
|
||||
<a class="header-link" href="https://github.com/IBM-Swift/Swift-SMTP/">
|
||||
<a class="header-link" href="https://github.com/Kitura/Swift-SMTP/">
|
||||
<img class="header-icon" src="img/gh.png"/>
|
||||
View on GitHub
|
||||
</a>
|
||||
@@ -75,6 +75,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP.html">SMTP</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/SMTP/TLSMode.html">– TLSMode</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Structs/TLSConfiguration.html">TLSConfiguration</a>
|
||||
</li>
|
||||
@@ -96,15 +99,15 @@
|
||||
<article class="main-content">
|
||||
|
||||
<section class="section">
|
||||
<div class="section-content">
|
||||
<div class="section-content top-matter">
|
||||
|
||||
<h1 id='swift-smtp' class='heading'>Swift-SMTP</h1>
|
||||
|
||||
<p><img src="https://github.com/IBM-Swift/Swift-SMTP/blob/master/Assets/swift-smtp-bird.png?raw=true" alt="Swift-SMTP bird"></p>
|
||||
<p><img src="https://github.com/Kitura/Swift-SMTP/blob/master/Assets/swift-smtp-bird.png?raw=true" alt="Swift-SMTP bird"></p>
|
||||
|
||||
<p>Swift SMTP client.</p>
|
||||
|
||||
<p><img src="https://travis-ci.org/IBM-Swift/Swift-SMTP.svg?branch=master" alt="Build Status">
|
||||
<p><img src="https://travis-ci.org/Kitura/Swift-SMTP.svg?branch=master" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/os-macOS-green.svg?style=flat" alt="macOS">
|
||||
<img src="https://img.shields.io/badge/os-linux-green.svg?style=flat" alt="Linux">
|
||||
<img src="https://img.shields.io/badge/license-Apache2-blue.svg?style=flat" alt="Apache 2"></p>
|
||||
@@ -115,14 +118,43 @@
|
||||
<li>Authenticate with CRAM-MD5, LOGIN, PLAIN, or XOAUTH2</li>
|
||||
<li>Send emails with local file, HTML, and raw data attachments</li>
|
||||
<li>Add custom headers</li>
|
||||
<li><a href="https://ibm-swift.github.io/Swift-SMTP/">Documentation</a></li>
|
||||
<li><a href="https://kitura.github.io/Swift-SMTP/">Documentation</a></li>
|
||||
</ul>
|
||||
<h2 id='swift-version' class='heading'>Swift Version</h2>
|
||||
|
||||
<p>macOS & Linux: <code>Swift 4.0.3</code> or <code>Swift 4.1</code></p>
|
||||
<p>macOS & Linux: <code>Swift 4.0.3</code>, <code>Swift 4.1</code> and <code>Swift 4.1.2</code></p>
|
||||
<h2 id='installation' class='heading'>Installation</h2>
|
||||
|
||||
<p>You can add <code>SwiftSMTP</code> to your project using <a href="https://swift.org/package-manager/">Swift Package Manager</a>. If your project does not have a <code>Package.swift</code> file, create one by running <code>swift package init</code> in the root directory of your project. Then open <code>Package.swift</code> and add <code>SwiftSMTP</code> as a dependency. Be sure to add it to your desired targets as well:</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// swift-tools-version:4.0</span>
|
||||
|
||||
<span class="kd">import</span> <span class="kt">PackageDescription</span>
|
||||
|
||||
<span class="k">let</span> <span class="nv">package</span> <span class="o">=</span> <span class="kt">Package</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">products</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">library</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">targets</span><span class="p">:</span> <span class="p">[</span><span class="s">"MyProject"</span><span class="p">]),</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">package</span><span class="p">(</span><span class="nv">url</span><span class="p">:</span> <span class="s">"https://github.com/Kitura/Swift-SMTP"</span><span class="p">,</span> <span class="o">.</span><span class="nf">upToNextMinor</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="s">"5.1.0"</span><span class="p">)),</span> <span class="c1">// add the dependency</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">targets</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">target</span><span class="p">(</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProject"</span><span class="p">,</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span><span class="s">"SwiftSMTP"</span><span class="p">]),</span> <span class="c1">// add targets</span>
|
||||
<span class="o">.</span><span class="nf">testTarget</span><span class="p">(</span> <span class="c1">// note "SwiftSMTP" (NO HYPHEN)</span>
|
||||
<span class="nv">name</span><span class="p">:</span> <span class="s">"MyProjectTests"</span><span class="p">,</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span><span class="s">"MyProject"</span><span class="p">]),</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>After adding the dependency and saving, run <code>swift package generate-xcodeproj</code> in the root directory of your project. This will fetch dependencies and create an Xcode project which you can open and begin editing.</p>
|
||||
<h2 id='migration-guide' class='heading'>Migration Guide</h2>
|
||||
|
||||
<p>Version <code>4.0.0</code> & <code>3.0.0</code> bring breaking changes. See the quick migration guide <a href="https://github.com/IBM-Swift/Swift-SMTP/blob/master/migration-guide.md">here</a>.</p>
|
||||
<p>Version <code>5.0.0</code> brings breaking changes. See the quick migration guide <a href="https://github.com/Kitura/Swift-SMTP/blob/master/migration-guide.md">here</a>.</p>
|
||||
<h2 id='usage' class='heading'>Usage</h2>
|
||||
|
||||
<p>Initialize an <code><a href="Structs/SMTP.html">SMTP</a></code> instance:</p>
|
||||
@@ -140,15 +172,15 @@
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">email</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">465</span><span class="p">,</span>
|
||||
<span class="nv">useTLS</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
|
||||
<span class="nv">port</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="mi">587</span><span class="p">,</span>
|
||||
<span class="nv">tlsMode</span><span class="p">:</span> <span class="kt">TLSMode</span> <span class="o">=</span> <span class="o">.</span><span class="n">requireSTARTTLS</span><span class="p">,</span>
|
||||
<span class="nv">tlsConfiguration</span><span class="p">:</span> <span class="kt">TLSConfiguration</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">authMethods</span><span class="p">:</span> <span class="p">[</span><span class="kt">AuthMethod</span><span class="p">]</span> <span class="o">=</span> <span class="p">[],</span>
|
||||
<span class="nv">domainName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"localhost"</span><span class="p">,</span>
|
||||
<span class="nv">timeout</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>By default, the <code><a href="Structs/SMTP.html">SMTP</a></code> struct connects on port <code>465</code> and tries to connect using TLS. It also uses a <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code> that uses no backing certificates. Configure these to your needs. For more info on <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code>, view the <a href="https://ibm-swift.github.io/Swift-SMTP/Structs/TLSConfiguration.html">docs</a>.</p>
|
||||
<p>By default, the <code><a href="Structs/SMTP.html">SMTP</a></code> struct connects on port <code>587</code> and sends mail only if a TLS connection can be established. It also uses a <code><a href="Structs/TLSConfiguration.html">TLSConfiguration</a></code> that uses no backing certificates. View the <a href="https://kitura.github.io/Swift-SMTP/">docs</a> for more configuration options.</p>
|
||||
<h3 id='send-email' class='heading'>Send email</h3>
|
||||
|
||||
<p>Create a <code><a href="Structs/Mail.html">Mail</a></code> object and use your <code><a href="Structs/SMTP.html">SMTP</a></code> handle to send it. To set the sender and receiver of an email, use the <code>User</code> struct:</p>
|
||||
@@ -256,8 +288,8 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2018-04-30)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>© 2020 <a class="link" href="" target="_blank" rel="external">IBM and Kitura project contributors</a>. All rights reserved. (Last updated: 2020-12-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
</div>
|
||||
|
||||
+45
-18
@@ -8,26 +8,41 @@ if (navigator.userAgent.match(/xcode/i)) {
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
function toggleItem($link, $content) {
|
||||
var animationDuration = 300;
|
||||
$link.toggleClass('token-open');
|
||||
$content.slideToggle(animationDuration);
|
||||
}
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
function itemLinkToContent($link) {
|
||||
return $link.parent().parent().next();
|
||||
}
|
||||
|
||||
// On doc load + hash-change, open any targetted item
|
||||
function openCurrentItemIfClosed() {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
|
||||
$content = itemLinkToContent($link);
|
||||
if ($content.is(':hidden')) {
|
||||
toggleItem($link, $content);
|
||||
}
|
||||
}
|
||||
|
||||
$(openCurrentItemIfClosed);
|
||||
$(window).on('hashchange', openCurrentItemIfClosed);
|
||||
|
||||
// On item link ('token') click, toggle its discussion
|
||||
$('.token').on('click', function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var $link = $(this);
|
||||
toggleItem($link, itemLinkToContent($link));
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
var href = $link.attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
@@ -36,8 +51,20 @@ $(".token").click(function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Dumb down quotes within code blocks that delimit strings instead of quotations
|
||||
// https://github.com/realm/jazzy/issues/714
|
||||
$("code q").replaceWith(function () {
|
||||
return ["\"", $(this).contents(), "\""];
|
||||
// Clicks on links to the current, closed, item need to open the item
|
||||
$("a:not('.token')").on('click', function() {
|
||||
if (location == this.href) {
|
||||
openCurrentItemIfClosed();
|
||||
}
|
||||
});
|
||||
|
||||
// KaTeX rendering
|
||||
if ("katex" in window) {
|
||||
$($('.math').each( (_, element) => {
|
||||
katex.render(element.textContent, element, {
|
||||
displayMode: $(element).hasClass('m-block'),
|
||||
throwOnError: false,
|
||||
trust: true
|
||||
});
|
||||
}))
|
||||
}
|
||||
|
||||
+17
-9
@@ -1,9 +1,4 @@
|
||||
$(function(){
|
||||
var searchIndex = lunr(function() {
|
||||
this.ref('url');
|
||||
this.field('name');
|
||||
});
|
||||
|
||||
var $typeahead = $('[data-typeahead]');
|
||||
var $form = $typeahead.parents('form');
|
||||
var searchURL = $form.attr('action');
|
||||
@@ -26,21 +21,34 @@ $(function(){
|
||||
$form.addClass('loading');
|
||||
|
||||
$.getJSON(searchURL).then(function(searchData) {
|
||||
$.each(searchData, function (url, doc) {
|
||||
searchIndex.add({url: url, name: doc.name});
|
||||
const searchIndex = lunr(function() {
|
||||
this.ref('url');
|
||||
this.field('name');
|
||||
this.field('abstract');
|
||||
for (const [url, doc] of Object.entries(searchData)) {
|
||||
this.add({url: url, name: doc.name, abstract: doc.abstract});
|
||||
}
|
||||
});
|
||||
|
||||
$typeahead.typeahead(
|
||||
{
|
||||
highlight: true,
|
||||
minLength: 3
|
||||
minLength: 3,
|
||||
autoselect: true
|
||||
},
|
||||
{
|
||||
limit: 10,
|
||||
display: displayTemplate,
|
||||
templates: { suggestion: suggestionTemplate },
|
||||
source: function(query, sync) {
|
||||
var results = searchIndex.search(query).map(function(result) {
|
||||
const lcSearch = query.toLowerCase();
|
||||
const results = searchIndex.query(function(q) {
|
||||
q.term(lcSearch, { boost: 100 });
|
||||
q.term(lcSearch, {
|
||||
boost: 10,
|
||||
wildcard: lunr.Query.wildcard.TRAILING
|
||||
});
|
||||
}).map(function(result) {
|
||||
var doc = searchData[result.ref];
|
||||
doc.url = result.ref;
|
||||
return doc;
|
||||
|
||||
+2
-4
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+209
-53
@@ -1,18 +1,19 @@
|
||||
/*!
|
||||
* typeahead.js 0.11.1
|
||||
* https://github.com/twitter/typeahead.js
|
||||
* Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
|
||||
* typeahead.js 1.3.1
|
||||
* https://github.com/corejavascript/typeahead.js
|
||||
* Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("typeahead.js", [ "jquery" ], function(a0) {
|
||||
define([ "jquery" ], function(a0) {
|
||||
return factory(a0);
|
||||
});
|
||||
} else if (typeof exports === "object") {
|
||||
} else if (typeof module === "object" && module.exports) {
|
||||
module.exports = factory(require("jquery"));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
factory(root["jQuery"]);
|
||||
}
|
||||
})(this, function($) {
|
||||
var _ = function() {
|
||||
@@ -148,6 +149,13 @@
|
||||
stringify: function(val) {
|
||||
return _.isString(val) ? val : JSON.stringify(val);
|
||||
},
|
||||
guid: function() {
|
||||
function _p8(s) {
|
||||
var p = (Math.random().toString(16) + "000000000").substr(2, 8);
|
||||
return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
|
||||
}
|
||||
return "tt-" + _p8() + _p8(true) + _p8(true) + _p8();
|
||||
},
|
||||
noop: function() {}
|
||||
};
|
||||
}();
|
||||
@@ -189,7 +197,7 @@
|
||||
function buildHtml(c) {
|
||||
return {
|
||||
wrapper: '<span class="' + c.wrapper + '"></span>',
|
||||
menu: '<div class="' + c.menu + '"></div>'
|
||||
menu: '<div role="listbox" class="' + c.menu + '"></div>'
|
||||
};
|
||||
}
|
||||
function buildSelectors(classes) {
|
||||
@@ -264,10 +272,8 @@
|
||||
}
|
||||
_.mixin(EventBus.prototype, {
|
||||
_trigger: function(type, args) {
|
||||
var $e;
|
||||
$e = $.Event(namespace + type);
|
||||
(args = args || []).unshift($e);
|
||||
this.$el.trigger.apply(this.$el, args);
|
||||
var $e = $.Event(namespace + type);
|
||||
this.$el.trigger.call(this.$el, $e, args || []);
|
||||
return $e;
|
||||
},
|
||||
before: function(type) {
|
||||
@@ -384,7 +390,36 @@
|
||||
tagName: "strong",
|
||||
className: null,
|
||||
wordsOnly: false,
|
||||
caseSensitive: false
|
||||
caseSensitive: false,
|
||||
diacriticInsensitive: false
|
||||
};
|
||||
var accented = {
|
||||
A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",
|
||||
B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",
|
||||
C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",
|
||||
D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",
|
||||
E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",
|
||||
F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",
|
||||
G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",
|
||||
H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",
|
||||
I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",
|
||||
J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",
|
||||
K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",
|
||||
L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",
|
||||
M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",
|
||||
N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",
|
||||
O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",
|
||||
P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",
|
||||
Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]",
|
||||
R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",
|
||||
S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",
|
||||
T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",
|
||||
U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",
|
||||
V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",
|
||||
W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",
|
||||
X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",
|
||||
Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",
|
||||
Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"
|
||||
};
|
||||
return function hightlight(o) {
|
||||
var regex;
|
||||
@@ -393,7 +428,7 @@
|
||||
return;
|
||||
}
|
||||
o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ];
|
||||
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
|
||||
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive);
|
||||
traverse(o.node, hightlightTextNode);
|
||||
function hightlightTextNode(textNode) {
|
||||
var match, patternNode, wrapperNode;
|
||||
@@ -419,10 +454,17 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
function getRegex(patterns, caseSensitive, wordsOnly) {
|
||||
function accent_replacer(chr) {
|
||||
return accented[chr.toUpperCase()] || chr;
|
||||
}
|
||||
function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) {
|
||||
var escapedPatterns = [], regexStr;
|
||||
for (var i = 0, len = patterns.length; i < len; i++) {
|
||||
escapedPatterns.push(_.escapeRegExChars(patterns[i]));
|
||||
var escapedWord = _.escapeRegExChars(patterns[i]);
|
||||
if (diacriticInsensitive) {
|
||||
escapedWord = escapedWord.replace(/\S/g, accent_replacer);
|
||||
}
|
||||
escapedPatterns.push(escapedWord);
|
||||
}
|
||||
regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
|
||||
return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
|
||||
@@ -441,6 +483,7 @@
|
||||
40: "down"
|
||||
};
|
||||
function Input(o, www) {
|
||||
var id;
|
||||
o = o || {};
|
||||
if (!o.input) {
|
||||
$.error("input is missing");
|
||||
@@ -448,6 +491,18 @@
|
||||
www.mixin(this);
|
||||
this.$hint = $(o.hint);
|
||||
this.$input = $(o.input);
|
||||
this.$menu = $(o.menu);
|
||||
id = this.$input.attr("id") || _.guid();
|
||||
this.$menu.attr("id", id + "_listbox");
|
||||
this.$hint.attr({
|
||||
"aria-hidden": true
|
||||
});
|
||||
this.$input.attr({
|
||||
"aria-owns": id + "_listbox",
|
||||
role: "combobox",
|
||||
"aria-autocomplete": "list",
|
||||
"aria-expanded": false
|
||||
});
|
||||
this.query = this.$input.val();
|
||||
this.queryWhenFocused = this.hasFocus() ? this.query : null;
|
||||
this.$overflowHelper = buildOverflowHelper(this.$input);
|
||||
@@ -455,6 +510,7 @@
|
||||
if (this.$hint.length === 0) {
|
||||
this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
|
||||
}
|
||||
this.onSync("cursorchange", this._updateDescendent);
|
||||
}
|
||||
Input.normalizeQuery = function(str) {
|
||||
return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
|
||||
@@ -524,6 +580,9 @@
|
||||
this.trigger("whitespaceChanged", this.query);
|
||||
}
|
||||
},
|
||||
_updateDescendent: function updateDescendent(event, id) {
|
||||
this.$input.attr("aria-activedescendant", id);
|
||||
},
|
||||
bind: function() {
|
||||
var that = this, onBlur, onFocus, onKeydown, onInput;
|
||||
onBlur = _.bind(this._onBlur, this);
|
||||
@@ -616,6 +675,9 @@
|
||||
this.$input.off(".tt");
|
||||
this.$overflowHelper.remove();
|
||||
this.$hint = this.$input = this.$overflowHelper = $("<div>");
|
||||
},
|
||||
setAriaExpanded: function setAriaExpanded(value) {
|
||||
this.$input.attr("aria-expanded", value);
|
||||
}
|
||||
});
|
||||
return Input;
|
||||
@@ -647,6 +709,7 @@
|
||||
"use strict";
|
||||
var keys, nameGenerator;
|
||||
keys = {
|
||||
dataset: "tt-selectable-dataset",
|
||||
val: "tt-selectable-display",
|
||||
obj: "tt-selectable-object"
|
||||
};
|
||||
@@ -666,19 +729,20 @@
|
||||
}
|
||||
www.mixin(this);
|
||||
this.highlight = !!o.highlight;
|
||||
this.name = o.name || nameGenerator();
|
||||
this.name = _.toStr(o.name || nameGenerator());
|
||||
this.limit = o.limit || 5;
|
||||
this.displayFn = getDisplayFn(o.display || o.displayKey);
|
||||
this.templates = getTemplates(o.templates, this.displayFn);
|
||||
this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
|
||||
this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
|
||||
this._resetLastSuggestion();
|
||||
this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
|
||||
this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
|
||||
}
|
||||
Dataset.extractData = function extractData(el) {
|
||||
var $el = $(el);
|
||||
if ($el.data(keys.obj)) {
|
||||
return {
|
||||
dataset: $el.data(keys.dataset) || "",
|
||||
val: $el.data(keys.val) || "",
|
||||
obj: $el.data(keys.obj) || null
|
||||
};
|
||||
@@ -697,7 +761,7 @@
|
||||
} else {
|
||||
this._empty();
|
||||
}
|
||||
this.trigger("rendered", this.name, suggestions, false);
|
||||
this.trigger("rendered", suggestions, false, this.name);
|
||||
},
|
||||
_append: function append(query, suggestions) {
|
||||
suggestions = suggestions || [];
|
||||
@@ -708,7 +772,7 @@
|
||||
} else if (!this.$lastSuggestion.length && this.templates.notFound) {
|
||||
this._renderNotFound(query);
|
||||
}
|
||||
this.trigger("rendered", this.name, suggestions, true);
|
||||
this.trigger("rendered", suggestions, true, this.name);
|
||||
},
|
||||
_renderSuggestions: function renderSuggestions(query, suggestions) {
|
||||
var $fragment;
|
||||
@@ -749,7 +813,7 @@
|
||||
_.each(suggestions, function getSuggestionNode(suggestion) {
|
||||
var $el, context;
|
||||
context = that._injectQuery(query, suggestion);
|
||||
$el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
|
||||
$el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
|
||||
fragment.appendChild($el[0]);
|
||||
});
|
||||
this.highlight && highlight({
|
||||
@@ -787,7 +851,7 @@
|
||||
this.cancel = function cancel() {
|
||||
canceled = true;
|
||||
that.cancel = $.noop;
|
||||
that.async && that.trigger("asyncCanceled", query);
|
||||
that.async && that.trigger("asyncCanceled", query, that.name);
|
||||
};
|
||||
this.source(query, sync, async);
|
||||
!syncCalled && sync([]);
|
||||
@@ -800,16 +864,17 @@
|
||||
rendered = suggestions.length;
|
||||
that._overwrite(query, suggestions);
|
||||
if (rendered < that.limit && that.async) {
|
||||
that.trigger("asyncRequested", query);
|
||||
that.trigger("asyncRequested", query, that.name);
|
||||
}
|
||||
}
|
||||
function async(suggestions) {
|
||||
suggestions = suggestions || [];
|
||||
if (!canceled && rendered < that.limit) {
|
||||
that.cancel = $.noop;
|
||||
rendered += suggestions.length;
|
||||
that._append(query, suggestions.slice(0, that.limit - rendered));
|
||||
that.async && that.trigger("asyncReceived", query);
|
||||
var idx = Math.abs(rendered - that.limit);
|
||||
rendered += idx;
|
||||
that._append(query, suggestions.slice(0, idx));
|
||||
that.async && that.trigger("asyncReceived", query, that.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -840,10 +905,14 @@
|
||||
pending: templates.pending && _.templatify(templates.pending),
|
||||
header: templates.header && _.templatify(templates.header),
|
||||
footer: templates.footer && _.templatify(templates.footer),
|
||||
suggestion: templates.suggestion || suggestionTemplate
|
||||
suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate
|
||||
};
|
||||
function userSuggestionTemplate(context) {
|
||||
var template = templates.suggestion;
|
||||
return $(template(context)).attr("id", _.guid());
|
||||
}
|
||||
function suggestionTemplate(context) {
|
||||
return $("<div>").text(displayFn(context));
|
||||
return $('<div role="option">').attr("id", _.guid()).text(displayFn(context));
|
||||
}
|
||||
}
|
||||
function isValidName(str) {
|
||||
@@ -884,10 +953,11 @@
|
||||
this.trigger.apply(this, arguments);
|
||||
},
|
||||
_allDatasetsEmpty: function allDatasetsEmpty() {
|
||||
return _.every(this.datasets, isDatasetEmpty);
|
||||
function isDatasetEmpty(dataset) {
|
||||
return dataset.isEmpty();
|
||||
}
|
||||
return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) {
|
||||
var isEmpty = dataset.isEmpty();
|
||||
this.$node.attr("aria-expanded", !isEmpty);
|
||||
return isEmpty;
|
||||
}, this));
|
||||
},
|
||||
_getSelectables: function getSelectables() {
|
||||
return this.$node.find(this.selectors.selectable);
|
||||
@@ -912,6 +982,12 @@
|
||||
var that = this, onSelectableClick;
|
||||
onSelectableClick = _.bind(this._onSelectableClick, this);
|
||||
this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
|
||||
this.$node.on("mouseover", this.selectors.selectable, function() {
|
||||
that.setCursor($(this));
|
||||
});
|
||||
this.$node.on("mouseleave", function() {
|
||||
that._removeCursor();
|
||||
});
|
||||
_.each(this.datasets, function(dataset) {
|
||||
dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
|
||||
});
|
||||
@@ -921,9 +997,11 @@
|
||||
return this.$node.hasClass(this.classes.open);
|
||||
},
|
||||
open: function open() {
|
||||
this.$node.scrollTop(0);
|
||||
this.$node.addClass(this.classes.open);
|
||||
},
|
||||
close: function close() {
|
||||
this.$node.attr("aria-expanded", false);
|
||||
this.$node.removeClass(this.classes.open);
|
||||
this._removeCursor();
|
||||
},
|
||||
@@ -988,6 +1066,55 @@
|
||||
});
|
||||
return Menu;
|
||||
}();
|
||||
var Status = function() {
|
||||
"use strict";
|
||||
function Status(options) {
|
||||
this.$el = $("<span></span>", {
|
||||
role: "status",
|
||||
"aria-live": "polite"
|
||||
}).css({
|
||||
position: "absolute",
|
||||
padding: "0",
|
||||
border: "0",
|
||||
height: "1px",
|
||||
width: "1px",
|
||||
"margin-bottom": "-1px",
|
||||
"margin-right": "-1px",
|
||||
overflow: "hidden",
|
||||
clip: "rect(0 0 0 0)",
|
||||
"white-space": "nowrap"
|
||||
});
|
||||
options.$input.after(this.$el);
|
||||
_.each(options.menu.datasets, _.bind(function(dataset) {
|
||||
if (dataset.onSync) {
|
||||
dataset.onSync("rendered", _.bind(this.update, this));
|
||||
dataset.onSync("cleared", _.bind(this.cleared, this));
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
_.mixin(Status.prototype, {
|
||||
update: function update(event, suggestions) {
|
||||
var length = suggestions.length;
|
||||
var words;
|
||||
if (length === 1) {
|
||||
words = {
|
||||
result: "result",
|
||||
is: "is"
|
||||
};
|
||||
} else {
|
||||
words = {
|
||||
result: "results",
|
||||
is: "are"
|
||||
};
|
||||
}
|
||||
this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate.");
|
||||
},
|
||||
cleared: function() {
|
||||
this.$el.text("");
|
||||
}
|
||||
});
|
||||
return Status;
|
||||
}();
|
||||
var DefaultMenu = function() {
|
||||
"use strict";
|
||||
var s = Menu.prototype;
|
||||
@@ -1052,6 +1179,7 @@
|
||||
this.input = o.input;
|
||||
this.menu = o.menu;
|
||||
this.enabled = true;
|
||||
this.autoselect = !!o.autoselect;
|
||||
this.active = false;
|
||||
this.input.hasFocus() && this.activate();
|
||||
this.dir = this.input.getLangDir();
|
||||
@@ -1098,8 +1226,12 @@
|
||||
_onDatasetCleared: function onDatasetCleared() {
|
||||
this._updateHint();
|
||||
},
|
||||
_onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) {
|
||||
_onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
|
||||
this._updateHint();
|
||||
if (this.autoselect) {
|
||||
var cursorClass = this.selectors.cursor.substr(1);
|
||||
this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
|
||||
}
|
||||
this.eventBus.trigger("render", suggestions, async, dataset);
|
||||
},
|
||||
_onAsyncRequested: function onAsyncRequested(type, dataset, query) {
|
||||
@@ -1122,15 +1254,25 @@
|
||||
_onEnterKeyed: function onEnterKeyed(type, $e) {
|
||||
var $selectable;
|
||||
if ($selectable = this.menu.getActiveSelectable()) {
|
||||
this.select($selectable) && $e.preventDefault();
|
||||
if (this.select($selectable)) {
|
||||
$e.preventDefault();
|
||||
$e.stopPropagation();
|
||||
}
|
||||
} else if (this.autoselect) {
|
||||
if (this.select(this.menu.getTopSelectable())) {
|
||||
$e.preventDefault();
|
||||
$e.stopPropagation();
|
||||
}
|
||||
}
|
||||
},
|
||||
_onTabKeyed: function onTabKeyed(type, $e) {
|
||||
var $selectable;
|
||||
if ($selectable = this.menu.getActiveSelectable()) {
|
||||
this.select($selectable) && $e.preventDefault();
|
||||
} else if ($selectable = this.menu.getTopSelectable()) {
|
||||
this.autocomplete($selectable) && $e.preventDefault();
|
||||
} else if (this.autoselect) {
|
||||
if ($selectable = this.menu.getTopSelectable()) {
|
||||
this.autocomplete($selectable) && $e.preventDefault();
|
||||
}
|
||||
}
|
||||
},
|
||||
_onEscKeyed: function onEscKeyed() {
|
||||
@@ -1144,12 +1286,12 @@
|
||||
},
|
||||
_onLeftKeyed: function onLeftKeyed() {
|
||||
if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
|
||||
this.autocomplete(this.menu.getTopSelectable());
|
||||
this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
|
||||
}
|
||||
},
|
||||
_onRightKeyed: function onRightKeyed() {
|
||||
if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
|
||||
this.autocomplete(this.menu.getTopSelectable());
|
||||
this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable());
|
||||
}
|
||||
},
|
||||
_onQueryChanged: function onQueryChanged(e, query) {
|
||||
@@ -1226,6 +1368,7 @@
|
||||
},
|
||||
open: function open() {
|
||||
if (!this.isOpen() && !this.eventBus.before("open")) {
|
||||
this.input.setAriaExpanded(true);
|
||||
this.menu.open();
|
||||
this._updateHint();
|
||||
this.eventBus.trigger("open");
|
||||
@@ -1234,6 +1377,7 @@
|
||||
},
|
||||
close: function close() {
|
||||
if (this.isOpen() && !this.eventBus.before("close")) {
|
||||
this.input.setAriaExpanded(false);
|
||||
this.menu.close();
|
||||
this.input.clearHint();
|
||||
this.input.resetInputValue();
|
||||
@@ -1249,9 +1393,9 @@
|
||||
},
|
||||
select: function select($selectable) {
|
||||
var data = this.menu.getSelectableData($selectable);
|
||||
if (data && !this.eventBus.before("select", data.obj)) {
|
||||
if (data && !this.eventBus.before("select", data.obj, data.dataset)) {
|
||||
this.input.setQuery(data.val, true);
|
||||
this.eventBus.trigger("select", data.obj);
|
||||
this.eventBus.trigger("select", data.obj, data.dataset);
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
@@ -1262,29 +1406,34 @@
|
||||
query = this.input.getQuery();
|
||||
data = this.menu.getSelectableData($selectable);
|
||||
isValid = data && query !== data.val;
|
||||
if (isValid && !this.eventBus.before("autocomplete", data.obj)) {
|
||||
if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) {
|
||||
this.input.setQuery(data.val);
|
||||
this.eventBus.trigger("autocomplete", data.obj);
|
||||
this.eventBus.trigger("autocomplete", data.obj, data.dataset);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
moveCursor: function moveCursor(delta) {
|
||||
var query, $candidate, data, payload, cancelMove;
|
||||
var query, $candidate, data, suggestion, datasetName, cancelMove, id;
|
||||
query = this.input.getQuery();
|
||||
$candidate = this.menu.selectableRelativeToCursor(delta);
|
||||
data = this.menu.getSelectableData($candidate);
|
||||
payload = data ? data.obj : null;
|
||||
suggestion = data ? data.obj : null;
|
||||
datasetName = data ? data.dataset : null;
|
||||
id = $candidate ? $candidate.attr("id") : null;
|
||||
this.input.trigger("cursorchange", id);
|
||||
cancelMove = this._minLengthMet() && this.menu.update(query);
|
||||
if (!cancelMove && !this.eventBus.before("cursorchange", payload)) {
|
||||
if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) {
|
||||
this.menu.setCursor($candidate);
|
||||
if (data) {
|
||||
this.input.setInputValue(data.val);
|
||||
if (typeof data.val === "string") {
|
||||
this.input.setInputValue(data.val);
|
||||
}
|
||||
} else {
|
||||
this.input.resetInputValue();
|
||||
this._updateHint();
|
||||
}
|
||||
this.eventBus.trigger("cursorchange", payload);
|
||||
this.eventBus.trigger("cursorchange", suggestion, datasetName);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1322,7 +1471,7 @@
|
||||
www = WWW(o.classNames);
|
||||
return this.each(attach);
|
||||
function attach() {
|
||||
var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor;
|
||||
var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor;
|
||||
_.each(datasets, function(d) {
|
||||
d.highlight = !!o.highlight;
|
||||
});
|
||||
@@ -1347,17 +1496,23 @@
|
||||
});
|
||||
input = new Input({
|
||||
hint: $hint,
|
||||
input: $input
|
||||
input: $input,
|
||||
menu: $menu
|
||||
}, www);
|
||||
menu = new MenuConstructor({
|
||||
node: $menu,
|
||||
datasets: datasets
|
||||
}, www);
|
||||
status = new Status({
|
||||
$input: $input,
|
||||
menu: menu
|
||||
});
|
||||
typeahead = new Typeahead({
|
||||
input: input,
|
||||
menu: menu,
|
||||
eventBus: eventBus,
|
||||
minLength: o.minLength
|
||||
minLength: o.minLength,
|
||||
autoselect: o.autoselect
|
||||
}, www);
|
||||
$input.data(keys.www, www);
|
||||
$input.data(keys.typeahead, typeahead);
|
||||
@@ -1450,7 +1605,7 @@
|
||||
return query;
|
||||
} else {
|
||||
ttEach(this, function(t) {
|
||||
t.setVal(newVal);
|
||||
t.setVal(_.toStr(newVal));
|
||||
});
|
||||
return this;
|
||||
}
|
||||
@@ -1481,8 +1636,10 @@
|
||||
});
|
||||
}
|
||||
function buildHintFromInput($input, www) {
|
||||
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({
|
||||
autocomplete: "off",
|
||||
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
|
||||
readonly: true,
|
||||
required: false
|
||||
}).removeAttr("id name placeholder").removeClass("required").attr({
|
||||
spellcheck: "false",
|
||||
tabindex: -1
|
||||
});
|
||||
@@ -1495,7 +1652,6 @@
|
||||
style: $input.attr("style")
|
||||
});
|
||||
$input.addClass(www.classes.input).attr({
|
||||
autocomplete: "off",
|
||||
spellcheck: false
|
||||
});
|
||||
try {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -2,5 +2,5 @@
|
||||
"warnings": [
|
||||
|
||||
],
|
||||
"source_directory": "/Users/quanvo/Projects/Swift-SMTP"
|
||||
"source_directory": "/Users/dannys/projects/kitura/Swift-SMTP"
|
||||
}
|
||||
+25
-2
@@ -1,6 +1,29 @@
|
||||
# 5.0.0 Migration Guide
|
||||
|
||||
- The default port is now `587`.
|
||||
|
||||
- The `SMTP` struct is now initialized with a `TLSMode` enum instead of a `useTLS` Bool, allowing more configuration options:
|
||||
|
||||
```swift
|
||||
/// TLSMode enum for what form of connection security to enforce.
|
||||
public enum TLSMode {
|
||||
/// Upgrades the connection to TLS if STARTLS command is received, else sends mail without security.
|
||||
case normal
|
||||
|
||||
/// Send mail over plaintext and ignore STARTTLS commands and TLS options. Could throw an error if server requires TLS.
|
||||
case ignoreTLS
|
||||
|
||||
/// Only send mail after an initial successful TLS connection. Connection will fail if a TLS connection cannot be established. The default port, 587, will likely need to be adjusted depending on your server.
|
||||
case requireTLS
|
||||
|
||||
/// Expect a STARTTLS command from the server and require the connection is upgraded to TLS. Will throw if the server does not issue a STARTTLS command.
|
||||
case requireSTARTTLS
|
||||
}
|
||||
```
|
||||
|
||||
# 4.0.0 Migration Guide
|
||||
|
||||
- `User` struct now nested in `Mail` struct to avoid namespace issues [(69)](https://github.com/IBM-Swift/Swift-SMTP/pull/69). Create a user like so:
|
||||
- `User` struct now nested in `Mail` struct to avoid namespace issues [(69)](https://github.com/Kitura/Swift-SMTP/pull/69). Create a user like so:
|
||||
|
||||
```swift
|
||||
let sender = Mail.User(name: "Sloth", email: "sloth@gmail.com")
|
||||
@@ -19,7 +42,7 @@ let smtp = SMTP(
|
||||
)
|
||||
```
|
||||
|
||||
- Fixed a bug where the wrong `Attachment` was used an an alternative to text content when a `Mail` was initialized with multiple `Attachment`s [(67)](https://github.com/IBM-Swift/Swift-SMTP/pull/67)
|
||||
- Fixed a bug where the wrong `Attachment` was used an an alternative to text content when a `Mail` was initialized with multiple `Attachment`s [(67)](https://github.com/Kitura/Swift-SMTP/pull/67)
|
||||
|
||||
# 3.0.0 Migration Guide
|
||||
|
||||
|
||||
Reference in New Issue
Block a user