summaryrefslogtreecommitdiff
path: root/static/inferno/man2/smtp.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/smtp.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man2/smtp.2')
-rw-r--r--static/inferno/man2/smtp.256
1 files changed, 56 insertions, 0 deletions
diff --git a/static/inferno/man2/smtp.2 b/static/inferno/man2/smtp.2
new file mode 100644
index 00000000..f94cdf3d
--- /dev/null
+++ b/static/inferno/man2/smtp.2
@@ -0,0 +1,56 @@
+.TH SMTP 2
+.SH NAME
+smtp \- Simple Mail Transfer Protocol
+.SH SYNOPSIS
+.EX
+include "smtp.m";
+smtp := load Smtp Smtp->PATH;
+
+open: fn(server: string): (int, string);
+sendmail: fn(fromwhom: string,
+ towhom: list of string,
+ cc: list of string,
+ msg: list of string): (int, string);
+close: fn(): (int, string);
+.EE
+.SH DESCRIPTION
+.B Smtp
+provides an interface to the mail transport protocol SMTP.
+.PP
+.B Open
+opens a connection to the given SMTP
+.IR server .
+If
+.I server
+is nil,
+.B open
+uses the
+default mail server
+.BR $smtp ,
+which must be defined in
+.IR ndb (6).
+It returns -1 and an error message if the connection fails.
+.PP
+.B Sendmail
+sends mail to the SMTP server for subsequent delivery.
+The first argument names the sender, the list
+.I towhom
+names the
+recipients,
+.I cc
+is a list of CC's,
+and
+.I msg
+has the text of the message. The latter
+may simply be a list of one item containing the whole message, a list of lines of the message
+or any intermediate format. It returns -1 and an error message on failure.
+.PP
+.B Close
+closes the connection to the SMTP server.
+.SH SOURCE
+.B /appl/lib/smtp.b
+.SH SEE ALSO
+.IR sendmail (1),
+.IR acme (1)
+.SH BUGS
+Too much copying of strings is done, especially with large messages.