source: project/smtp/smtp.html @ 1270

Last change on this file since 1270 was 1270, checked in by felix winkelmann, 14 years ago

all simple eggs have proper setup script, now

File size: 4.2 KB
Line 
1<html>
2<head><title>Eggs Unlimited - smtp</title></head>
3<body>
4
5<center><img src="egg.jpg"></center>
6<center><a href="index.html">back</a></center>
7
8<h2>smtp</h2>
9
10<h3>Description:</h3>
11Send e-mails using the SMTP protocol (RFC821).
12
13<h3>Author:</h3>
14<a href="mailto:felix@call-with-current-continuation.org">felix</a>
15
16<h3>Version:</h3>
17<ul>
18<li>1.2
19Bugfix by Hans Bulfone
20<li>1.1
21Fixed bug that replaced all occurrences of <code>"."</code> in SMTP headers with <code>".."</code>
22<li>1.0
23</ul>
24
25<h3>Usage:</h3>
26<pre>
27(require-extension smtp)
28</pre>
29
30<h3>Download:</h3>
31<a href="smtp.egg">smtp.egg</a>
32
33<h3>Documentation:</h3>
34
35Errors triggered by invalid or negative replies from the SMTP server are signalled
36by raising a compund condition of the kinds <code>exn</code> and <code>smtp</code>.
37The error code of a <code>smtp</code> condition can be accessed with the <code>code</code>
38property.
39
40<dl>
41<dt><pre><b>[procedure] (smtp:connect HOSTNAME DOMAINNAME [VERBOSE [PORT]])</b></pre>
42<dd>Connects to the server <code>HOSTNAME</code> using the SMTP protocol and identifies
43this client with <code>DOMAINNAME</code>. If the optional argument <code>VERBOSE</code> is
44given and not <code>#f</code>, then a protocol of the communication with the server is
45written to the value of <code>(current-error-port)</code>. <code>PORT</code> specifies
46the port-number and defaults to <code>25</code>.
47<bt>This procedure returns an object representing the SMTP session.
48
49<dt><pre><b>[procedure] (smtp:disconnect SMTP)</b></pre>
50<dd>Closes the connection identified by the session object <code>SMTP</code>.
51
52<dt><pre><b>[procedure] (smtp:smtp? X)</b></pre>
53<dd>Returns <code>#t</code> if <code>X</code> is an SMTP session object, or <code>#f</code>
54otherwise.
55
56<dt><pre><b>[procedure] (smtp:open SMTP FROM TO1 TO2...)</b></pre>
57<dd>Creates a message, where <code>FROM</code> and <code>TO1 TO2...</code> are strings representing
58the addresses of the sender and the receiver(s), respectively. This procedure returns an output-port
59that accepts text which is stored as the body of the message. Note that no default headers
60(other than "From:" and "Date:") are generated.
61Normally all headers
62(like "Subject:", etc.) are written first, followed by a completely blank line, followed
63by the body of the message.
64<br>It is not possible to call <code>smtp:open</code>
65before the port returned by a previously invoked call has been closed.
66</dl>
67
68
69<p><h3>Examples:</h3>
70
71<pre>
72(define s (smtp:connect "smtp.your-isp.net" (get-host-name)))
73(with-output-to-port (smtp:open s "me@my-isp.net" "you@your-isp.net")
74  (lambda ()
75    (print "Subject: How are you?\r\n\r\nSo, how are you then?\r\n") ) )
76(smtp:disconnect s)
77</pre>
78
79<h3>License:</h3>
80<pre>
81Copyright (c) 2003, Felix L. Winkelmann
82All rights reserved.
83
84Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
85conditions are met:
86
87  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
88    disclaimer.
89  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
90    disclaimer in the documentation and/or other materials provided with the distribution.
91  Neither the name of the author nor the names of its contributors may be used to endorse or promote
92    products derived from this software without specific prior written permission.
93
94THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
95OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
96AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
97CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
98CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
99SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
100THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
101OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
102POSSIBILITY OF SUCH DAMAGE.
103</pre>
104
105
106<hr><a href="index.html">back</a>
107
108</body>
109</html>
Note: See TracBrowser for help on using the repository browser.