]> gitweb.factorcode.org Git - factor.git/blob - basis/smtp/smtp-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / smtp / smtp-docs.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel quotations help.syntax help.markup
4 io.sockets strings calendar ;
5 IN: smtp
6
7 HELP: smtp-server
8 { $description "Holds an " { $link inet } " object with the address of an SMTP server." } ;
9
10 HELP: smtp-read-timeout
11 { $description "Holds an " { $link duration } " object that specifies how long to wait for a response from the SMTP server." } ;
12
13 HELP: with-smtp-connection
14 { $values { "quot" quotation } }
15 { $description "Connects to an SMTP server stored in " { $link smtp-server } " and calls the quotation." } ;
16
17 HELP: <email>
18 { $values { "email" email } }
19 { $description "Creates an empty " { $link email } " object." } ;
20
21 HELP: send-email
22 { $values { "email" email } }
23 { $description "Sends an " { $link email } " object to an STMP server stored in the " { $link smtp-server } " variable.  The required slots are " { $slot "from" } " and " { $slot "to" } "." }
24 { $examples
25     { $unchecked-example "USING: accessors smtp ;"
26     "<email>"
27     "    \"groucho@marx.bros\" >>from"
28     "    { \"chico@marx.bros\" \"harpo@marx.bros\" } >>to"
29     "    { \"gummo@marx.bros\" } >>cc"
30     "    { \"zeppo@marx.bros\" } >>bcc"
31     "    \"Pickup line\" >>subject"
32     "    \"If I said you had a beautiful body, would you hold it against me?\" >>body"
33     "send-email"
34     ""
35     }
36 } ;
37
38 ARTICLE: "smtp" "SMTP Client Library"
39 "Sending an email:"
40 { $subsection send-email } ;