2008-08-29 00:19:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								! Copyright (C) 2008 Doug Coleman. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								! See http://factorcode.org/license.txt for BSD license. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								USING:  accessors  kernel  quotations  help.syntax  help.markup 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								io.sockets strings calendar ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								IN:  smtp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-12 11:29:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								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."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-08-29 00:19:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								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."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-12 11:29:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  esmtp? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Set true by default, determines whether the SMTP client is using the Extended SMTP protocol."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-08-29 00:19:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  with-smtp-connection 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Connects to an SMTP server stored in "  { $link smtp-server } " and calls the quotation."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  <email> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "email"  email } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Creates an empty "  { $link email } " object."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  send-email 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "email"  email } }
							 
						 
					
						
							
								
									
										
										
										
											2008-09-09 19:55:49 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $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"  } "."  }
							 
						 
					
						
							
								
									
										
										
										
											2008-08-29 00:19:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-08-29 17:48:29 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    { $unchecked-example "USING: accessors smtp ;" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "<email>" 
							 
						 
					
						
							
								
									
										
										
										
											2008-08-29 00:19:18 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    "    \"groucho@marx.bros\" >>from" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "    { \"chico@marx.bros\" \"harpo@marx.bros\" } >>to" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "    { \"gummo@marx.bros\" } >>cc" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "    { \"zeppo@marx.bros\" } >>bcc" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "    \"Pickup line\" >>subject" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "    \"If I said you had a beautiful body, would you hold it against me?\" >>body" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "send-email" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-23 17:19:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ARTICLE: "smtp"  "SMTP client library" 
							 
						 
					
						
							
								
									
										
										
										
											2008-09-12 11:29:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Configuring SMTP:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection smtp-server }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection smtp-read-timeout }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection smtp-domain }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection esmtp? }
							 
						 
					
						
							
								
									
										
										
										
											2008-09-09 19:55:49 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Sending an email:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsection send-email } ;