Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/smtp|the CHICKEN 4 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == smtp [[toc:]] === Description Send e-mails using the SMTP protocol (RFC821). === Author [[/users/felix winkelmann|felix winkelmann]] === Requirements None === Download [[http://code.call-cc.org/legacy-eggs/3/smtp.egg|smtp.egg]] === Documentation Errors triggered by invalid or negative replies from the SMTP server are signalled by raising a compund condition of the kinds {{exn}} and {{smtp}}. The error code of a {{smtp}} condition can be accessed with the {{code}} property. <procedure>(smtp:connect HOSTNAME DOMAINNAME [VERBOSE [PORT]])</procedure> Connects to the server {{HOSTNAME}} using the SMTP protocol and identifies this client with {{DOMAINNAME}}. If the optional argument {{VERBOSE}} is given and not {{#f}}, then a protocol of the communication with the server is written to the value of {{(current-error-port)}}. {{PORT}} specifies the port-number and defaults to {{25}}. This procedure returns an object representing the SMTP session. <procedure>(smtp:disconnect SMTP)</procedure> Closes the connection identified by the session object {{SMTP}}. <procedure>(smtp:smtp? X)</procedure> Returns {{#t}} if {{X}} is an SMTP session object, or {{#f}} otherwise. <procedure>(smtp:open SMTP FROM TO1 TO2...)</procedure> Creates a message, where {{FROM}} and {{TO1 TO2...}} are strings representing the addresses of the sender and the receiver(s), respectively. This procedure returns an output-port that accepts text which is stored as the body of the message. Note that no default headers (other than "From:" and "Date:") are generated. Normally all headers (like "Subject:", etc.) are written first, followed by a completely blank line, followed by the body of the message. It is not possible to call {{smtp:open}} before the port returned by a previously invoked call has been closed. === Example <enscript highlight="scheme"> (use smtp) (define s (smtp:connect "smtp.your-isp.net" (get-host-name))) (define p (smtp:open s "me@my-isp.net" "you@your-isp.net")) (display "Subject: How are you?\r\n\r\nSo, how are you then?\r\n\n" p) (close-output-port p) (smtp:disconnect s) </enscript> === Changelog * 1.3 Uses {{flush-output}} after sending message [Thanks to Daishi Kato] * 1.2 Bugfix by Hans Bulfone * 1.1 Fixed bug that replaced all occurrences of {{"."}} in SMTP headers with {{".."}} * 1.0 Initial release === License Copyright (c) 2003-2008, Felix L. Winkelmann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 8 to 22?