Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
17
Task/Send-email/Nim/send-email.nim
Normal file
17
Task/Send-email/Nim/send-email.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import smtp, net
|
||||
|
||||
proc sendMail(fromAddr: string; toAddrs, ccAddrs: seq[string];
|
||||
subject, message, login, password: string;
|
||||
server = "smtp.gmail.com"; port = Port 465; ssl = true) =
|
||||
var msg = createMessage(subject, message, toAddrs, ccAddrs)
|
||||
var s = connect(server, port, ssl, debug = true)
|
||||
s.auth(login, password)
|
||||
s.sendmail(fromAddr, toAddrs, $msg)
|
||||
|
||||
sendMail(fromAddr = "nim@gmail.com",
|
||||
toAddrs = @["someone@example.com"],
|
||||
ccAddrs = @[],
|
||||
subject = "Hi from Nim",
|
||||
message = "Nim says hi!\nAnd bye again!",
|
||||
login = "nim@gmail.com",
|
||||
password = "XXXXXX")
|
||||
Loading…
Add table
Add a link
Reference in a new issue