]> 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-domain
8 { $description "The name of the machine that is sending the email.  This variable will be filled in by the " { $link host-name } " word if not set by the user." } ;
9
10 HELP: smtp-server
11 { $description "Holds an " { $link inet } " object with the address of an SMTP server." } ;
12
13 HELP: smtp-read-timeout
14 { $description "Holds an " { $link duration } " object that specifies how long to wait for a response from the SMTP server." } ;
15
16 HELP: esmtp?
17 { $description "Set true by default, determines whether the SMTP client is using the Extended SMTP protocol." } ;
18
19 HELP: with-smtp-connection
20 { $values { "quot" quotation } }
21 { $description "Connects to an SMTP server stored in " { $link smtp-server } " and calls the quotation." } ;
22
23 HELP: <email>
24 { $values { "email" email } }
25 { $description "Creates an empty " { $link email } " object." } ;
26
27 HELP: send-email
28 { $values { "email" email } }
29 { $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" } "." }
30 { $examples
31     { $unchecked-example "USING: accessors smtp ;"
32     "<email>"
33     "    \"groucho@marx.bros\" >>from"
34     "    { \"chico@marx.bros\" \"harpo@marx.bros\" } >>to"
35     "    { \"gummo@marx.bros\" } >>cc"
36     "    { \"zeppo@marx.bros\" } >>bcc"
37     "    \"Pickup line\" >>subject"
38     "    \"If I said you had a beautiful body, would you hold it against me?\" >>body"
39     "send-email"
40     ""
41     }
42 } ;
43
44 ARTICLE: "smtp" "SMTP Client Library"
45 "Configuring SMTP:"
46 { $subsection smtp-server }
47 { $subsection smtp-read-timeout }
48 { $subsection smtp-domain }
49 { $subsection esmtp? }
50 "Sending an email:"
51 { $subsection send-email } ;