From 89e6ea1bbeb39f69464154214a28821bf9c49994 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 14 Mar 2009 11:59:18 -0500 Subject: [PATCH] add tutorial for setting up smtp to work with gmail --- basis/smtp/smtp-docs.factor | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/basis/smtp/smtp-docs.factor b/basis/smtp/smtp-docs.factor index 8e34411604..453f4009e2 100644 --- a/basis/smtp/smtp-docs.factor +++ b/basis/smtp/smtp-docs.factor @@ -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 } " tuple with our login. Next, we set the gmail server address with an " { $link } " 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\" smtp-auth set-global" + "" + "\"smtp.gmail.com\" 587 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 } "Sending an email:" -{ $subsection send-email } ; +{ $subsection send-email } +"More topics:" +{ $subsection "smtp-gmail" } ; ABOUT: "smtp"