]> gitweb.factorcode.org Git - factor.git/commitdiff
add tutorial for setting up smtp to work with gmail
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 14 Mar 2009 16:59:18 +0000 (11:59 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 14 Mar 2009 16:59:18 +0000 (11:59 -0500)
basis/smtp/smtp-docs.factor

index 8e344116040edd5b11e1d5d4eb97f5483784d221..453f4009e281c61345e9c2dcbf52421af4edce9f 100644 (file)
@@ -73,6 +73,20 @@ HELP: send-email
     }
 } ;
 
+ARTICLE: "smtp-gmail" "Setting up SMTP with gmail"
+"If you plan to send all email from the same address, then setting variables in the global namespace is the best option. The code example below does this approach and is meant to go in your " { $link "factor-boot-rc" } "." $nl
+"Several variables need to be set for sending outgoing mail through gmail. First, we set the login and password to a " { $link <plain-auth> } " tuple with our login. Next, we set the gmail server address with an " { $link <inet> } " object. Finally, we tell the SMTP library to use a secure connection."
+{ $code
+    "USING: smtp namespaces io.sockets ;"
+    ""
+    "\"my.gmail.address@gmail.com\" \"secret-password\" <plain-auth> smtp-auth set-global"
+    ""
+    "\"smtp.gmail.com\" 587 <inet> smtp-server set-global"
+    ""
+    "t smtp-tls? set-global"
+} ;
+
+
 ARTICLE: "smtp" "SMTP client library"
 "The " { $vocab-link "smtp" } " vocabulary sends e-mail via an SMTP server."
 $nl
@@ -89,6 +103,8 @@ $nl
 { $subsection email }
 { $subsection <email> }
 "Sending an email:"
-{ $subsection send-email } ;
+{ $subsection send-email }
+"More topics:"
+{ $subsection "smtp-gmail" } ;
 
 ABOUT: "smtp"