Types
Message = object
ReplyError = object of IOError
Smtp = ref object closed*: bool case kind*: SmtpClientScheme of SmtpClientScheme.NonSecure: nil of SmtpClientScheme.Secure: treader*: AsyncStreamReader twriter*: AsyncStreamWriter tls*: TLSAsyncStream flags*: set[TLSFlags] transp*: StreamTransport reader*: AsyncStreamReader writer*: AsyncStreamWriter host*: string port*: Port
SmtpClientScheme {.pure.} = enum NonSecure, Secure
SmtpError = object of AsyncError
Procs
proc authCommand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc checkReply(smtp: Smtp; reply: string; quitWhenFailed: bool = true): Future[ void] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
proc createMessage(mSubject, mBody: string; mTo, mCc: seq[string]; otherHeaders: openArray[tuple[name, value: string]]): Message {. ...raises: [], tags: [], forbids: [].}
-
Creates a new MIME compliant message.
You need to make sure that mSubject, mTo and mCc don't contain any newline characters. Failing to do so will raise AssertionDefect.
proc createMessage(mSubject, mBody: string; mTo: seq[string] = @[]; mCc: seq[string] = @[]): Message {....raises: [], tags: [], forbids: [].}
-
Alternate version of the above.
You need to make sure that mSubject, mTo and mCc don't contain any newline characters. Failing to do so will raise AssertionDefect.
proc dataCommand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc ehloCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc expnCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc heloCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc helpCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc lhloCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc mailCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc noopCommand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc quitComand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc rcptCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}
proc resetCommand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc sendMail(smtp: Smtp; fromAddr: string; toAddrs: seq[string]; msg: string): Future[ void] {....stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
-
Sends msg from fromAddr to the addresses specified in toAddrs. Messages may be formed using createMessage by converting the Message into a string.
You need to make sure that fromAddr and toAddrs don't contain any newline characters. Failing to do so will raise AssertionDefect.
proc starttlsCommand(): string {.inline, ...raises: [], tags: [], forbids: [].}
proc vrfyCommand(param: string): string {.inline, ...raises: [], tags: [], forbids: [].}