Amazon SES for Common Lisp (Lispworks)AWS-SES.lisp is a simple code allowing users to send emails via Amazon Simple Email Service (Amazon SES). It requires no additional lisp libraries -- all the required lisp code is included in one file. The code depends on OpenSSL libraries and works with any Lispworks version 6.0 or higher.
Click here to download AWS-SES.lisp (ver:20140129, 20Kb)
Example of usage
(load "aws-ses.lisp") (comm:set-ssl-library-path '("c:/lib/libeay32.dll" "c:/lib/libssl32.dll")) (comm:ensure-ssl) (aws-ses:send-email :from "email@example.com" :to "firstname.lastname@example.org" :subject "Hello" :message "Hello, world!" :aws-access-key "AWS-ACCESS-KEY" :aws-secret-key "AWS-SECRET-KEY"))
Before using the code the OpenSSL libraries should be initialized by the function ensure-ssl from the comm package. See Chapters 21.6.9 "Obtaining and installing the OpenSSL library" and 126.96.36.199 "Loading the OpenSSL libraries" in the "LispWorks User Guide and Reference Manual".
You can only send an email message to one recipient. There is support for messages in plain text only. The code was not extensively tested.
AWS-SES.lisp defines AWS-SES package and exports one symbol as a public interface.
Symbols available in the AWS-SES package:
send-email &key from to subject message aws-access-key aws-secret-key => result content
Sends an email message.
from a string with the email address of a sender
to a string with the email address of a recipient
subject a string with the subject of the email
message a string with the message of the email
aws-access-key a string of Access Key ID of your Amazon Access Credentials
aws-secret-key a string of Secret Access Key of your Amazon Access Credentials
result t if sending a message succeeded or nil if failed
content a string with the response message
Email to artobrezan[at]yahoo.com
Copyright (c) 2013, Art Obrezan
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.
- Use in source and binary forms are not permitted in projects under GNU General Public Licenses and its derivatives.
THIS SOFTWARE IS PROVIDED BY ART OBREZAN ''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 ART OBREZAN 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.