Make SMTP example compile
This commit is contained in:
parent
ef9a9b119d
commit
d4cf5d13f0
1 changed files with 7 additions and 5 deletions
|
|
@ -20,9 +20,9 @@
|
||||||
## var msg = createMessage("Hello from Nim's SMTP",
|
## var msg = createMessage("Hello from Nim's SMTP",
|
||||||
## "Hello!.\n Is this awesome or what?",
|
## "Hello!.\n Is this awesome or what?",
|
||||||
## @["foo@gmail.com"])
|
## @["foo@gmail.com"])
|
||||||
## var smtp = connect("smtp.gmail.com", 465, true, true)
|
## var smtpConn = connect("smtp.gmail.com", Port 465, true, true)
|
||||||
## smtp.auth("username", "password")
|
## smtpConn.auth("username", "password")
|
||||||
## smtp.sendmail("username@gmail.com", @["foo@gmail.com"], $msg)
|
## smtpConn.sendmail("username@gmail.com", @["foo@gmail.com"], $msg)
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## For SSL support this module relies on OpenSSL. If you want to
|
## For SSL support this module relies on OpenSSL. If you want to
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
import net, strutils, strtabs, base64, os
|
import net, strutils, strtabs, base64, os
|
||||||
import asyncnet, asyncdispatch
|
import asyncnet, asyncdispatch
|
||||||
|
|
||||||
|
export Port
|
||||||
|
|
||||||
type
|
type
|
||||||
Smtp* = object
|
Smtp* = object
|
||||||
sock: Socket
|
sock: Socket
|
||||||
|
|
@ -258,8 +260,8 @@ when not defined(testing) and isMainModule:
|
||||||
# "Hello, my name is dom96.\n What\'s yours?", @["dominik@localhost"])
|
# "Hello, my name is dom96.\n What\'s yours?", @["dominik@localhost"])
|
||||||
#echo(msg)
|
#echo(msg)
|
||||||
|
|
||||||
#var smtp = connect("localhost", 25, False, True)
|
#var smtpConn = connect("localhost", Port 25, false, true)
|
||||||
#smtp.sendmail("root@localhost", @["dominik@localhost"], $msg)
|
#smtpConn.sendmail("root@localhost", @["dominik@localhost"], $msg)
|
||||||
|
|
||||||
#echo(decode("a17sm3701420wbe.12"))
|
#echo(decode("a17sm3701420wbe.12"))
|
||||||
proc main() {.async.} =
|
proc main() {.async.} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue