]> gitweb.factorcode.org Git - factor.git/commitdiff
better smtp docs
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 12 Sep 2008 15:29:34 +0000 (10:29 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 12 Sep 2008 15:29:34 +0000 (10:29 -0500)
basis/smtp/smtp-docs.factor
basis/smtp/smtp.factor

index 435b04504d1f41bbb834d82fa789b43979108701..e859e082ff65cb7c244858954c31104221b6b367 100644 (file)
@@ -4,12 +4,18 @@ USING: accessors kernel quotations help.syntax help.markup
 io.sockets strings calendar ;
 IN: smtp
 
+HELP: smtp-domain
+{ $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." } ;
+
 HELP: smtp-server
 { $description "Holds an " { $link inet } " object with the address of an SMTP server." } ;
 
 HELP: smtp-read-timeout
 { $description "Holds an " { $link duration } " object that specifies how long to wait for a response from the SMTP server." } ;
 
+HELP: esmtp?
+{ $description "Set true by default, determines whether the SMTP client is using the Extended SMTP protocol." } ;
+
 HELP: with-smtp-connection
 { $values { "quot" quotation } }
 { $description "Connects to an SMTP server stored in " { $link smtp-server } " and calls the quotation." } ;
@@ -36,5 +42,10 @@ HELP: send-email
 } ;
 
 ARTICLE: "smtp" "SMTP Client Library"
+"Configuring SMTP:"
+{ $subsection smtp-server }
+{ $subsection smtp-read-timeout }
+{ $subsection smtp-domain }
+{ $subsection esmtp? }
 "Sending an email:"
 { $subsection send-email } ;
index f95ecddc1e6ad729bc67ee093693ee051c13d3a9..26bfea9a13ed544a240f2d8220bcf3ef8406e7ea 100755 (executable)
@@ -10,7 +10,7 @@ IN: smtp
 SYMBOL: smtp-domain
 SYMBOL: smtp-server     "localhost" "smtp" <inet> smtp-server set-global
 SYMBOL: smtp-read-timeout    1 minutes smtp-read-timeout set-global
-SYMBOL: esmtp           t esmtp set-global
+SYMBOL: esmtp?           t esmtp? set-global
 
 LOG: log-smtp-connection NOTICE ( addrspec -- )
 
@@ -39,7 +39,7 @@ TUPLE: email
 : command ( string -- ) write crlf flush ;
 
 : helo ( -- )
-    esmtp get "EHLO " "HELO " ? host-name append command ;
+    esmtp? get "EHLO " "HELO " ? host-name append command ;
 
 ERROR: bad-email-address email ;