diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2016-04-24 15:23:29 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2016-04-24 15:23:29 +0100 |
commit | f4b22818704ed8026d97c3626eeb753abb95f01c (patch) | |
tree | fce9681f5de14d4a552ab34811f24c10d004e679 /lib/pure | |
parent | ef9a9b119dbcdf00eb66a368efc5e07d0d8d4828 (diff) | |
parent | d4cf5d13f03c4fe8f063e1121d3748a5bbd12722 (diff) | |
download | Nim-f4b22818704ed8026d97c3626eeb753abb95f01c.tar.gz |
Merge pull request #4109 from def-/smtp-compile
Make SMTP example compile
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/smtp.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/pure/smtp.nim b/lib/pure/smtp.nim index b2adac2f3..050712902 100644 --- a/lib/pure/smtp.nim +++ b/lib/pure/smtp.nim @@ -20,9 +20,9 @@ ## var msg = createMessage("Hello from Nim's SMTP", ## "Hello!.\n Is this awesome or what?", ## @["foo@gmail.com"]) -## var smtp = connect("smtp.gmail.com", 465, true, true) -## smtp.auth("username", "password") -## smtp.sendmail("username@gmail.com", @["foo@gmail.com"], $msg) +## var smtpConn = connect("smtp.gmail.com", Port 465, true, true) +## smtpConn.auth("username", "password") +## smtpConn.sendmail("username@gmail.com", @["foo@gmail.com"], $msg) ## ## ## For SSL support this module relies on OpenSSL. If you want to @@ -31,6 +31,8 @@ import net, strutils, strtabs, base64, os import asyncnet, asyncdispatch +export Port + type Smtp* = object sock: Socket @@ -258,8 +260,8 @@ when not defined(testing) and isMainModule: # "Hello, my name is dom96.\n What\'s yours?", @["dominik@localhost"]) #echo(msg) - #var smtp = connect("localhost", 25, False, True) - #smtp.sendmail("root@localhost", @["dominik@localhost"], $msg) + #var smtpConn = connect("localhost", Port 25, false, true) + #smtpConn.sendmail("root@localhost", @["dominik@localhost"], $msg) #echo(decode("a17sm3701420wbe.12")) proc main() {.async.} = |