FunctionPackage: net.post-officeToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Moderately revised from 6.2. Significant update since 7.0 release.

send-smtp

Arguments: mail-server from to &rest message

This operator was modified in an update released around February 3, 2006. The change involved the allowable values for message (previously, message could only be a string). See sys:update-allegro for information on updating Allegro CL.

This function requests that a SMTP server send a message. The return value of this function is undefined. If this function returns rather than signaling an error, then it has "succeeded", where "success" means the SMTP server claimed that it received the message.

mail-server can be a string naming a machine, or an IP address (in dotted form, as an integer for IPv4 addresses, or an IPv6 address structure). The mail-server is contacted and asked to send a message (a string) from the email address specified by from to the email address or list of addresses specified by to. The email addresses must be of the form "foo" or "foo@bar.com". You can not use addresses like "Joe <foo@bar.com>" or "(Joe) foo@bar.com".

If the server specified by mail-server requires authentication, you should use send-smtp-auth, which works just like this function but has additional required arguments login and password.

The message sent is a concatenation of all of the message arguments (there can be as many as you like). messages should be strings or streams in any combination. (message cannot be a mime-part-constructed object, though see MIME messages below.) When a message is a stream, note the stream is read until an EOF is reached, but the stream is not closed nor is the file pointer reset.

A header is not prepended to the message. This means that the application program can build its own header if it wants to include in that header more than send-letter supports (e.g. a Mime encoded attachment). If no header is provided then some mail servers (e.g. sendmail) will notice this fact and will automatically create a header.

The text of the message should be lines separated by #\newline's. The smtp interface will automatically insert the necessary #\returns's when it transmits the message to the mail server.

MIME messages

As said above, message cannot be a mime-part-constructed object (see MIME support in imap.htm) but you can do something like this:

(setf p1 (make-mime-part 
	   :text "This is a test message"
	   :headers '(("From" . "Test User <joe@example.com>")
		      ("To" . "Recipient <jimmy@yahoo.com>")
		      ("Subject" . "This is a test email"))))
(with-mime-part-constructed-stream (s p1)
   (send-smtp mail-server "joe@example.com" "jimmy@yahoo.com" s))

See imap.htm for more information.


Copyright (c) 1998-2006, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 6.2 page.
Created 2005.9.20.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Moderately revised from 6.2. Significant update since 7.0 release.