SMTP Functions
SMTPSTREAM *smtp_open (char **hostlist,long debug);
hostlist vector of SMTP server host names to try
debug non-zero if want protocol telemetry debugging
This function opens an SMTP connection to a one of the hosts in the
host list and if successful returns a stream suitable for use by the
other SMTP functions. The hosts are tried in order until a connection is
successfully opened. If debug is non-NIL, protocol telemetry is logged
via mm_dlog(). NIL is returned if this function fails to open a
connection to any of the hosts in the list.
void smtp_close (SMTPSTREAM *stream);
stream stream to close
This function closes the SMTP stream and frees all resources
associated with it that it may have created.
long smtp_mail (SMTPSTREAM *stream,char *type,ENVELOPE *msg,BODY *body);
stream stream to transmit mail
type mail type (MAIL, SEND, SAML, SOML)
msg message envelope
body message body
This function negotiates an SMTP transaction of the specified type
(one of "MAIL", "SEND", "SAML", or "SOML") to deliver the specified
message. This function returns T if success or NIL if there is any
failure. The text reason for the failure is in stream->reply item; if
it is associated with a recipient it is also in that address'
address->error item.
void smtp_debug (SMTPSTREAM *stream);
stream stream to enable debugging telemetry
This function enables SMTP protocol telemetry logging for this
stream. All SMTP protocol operations are passed to the application via
the mm_dlog() facility.
void smtp_nodebug (SMTPSTREAM *stream);
stream stream to disable debugging telemetry
This function disables SMTP protocol telemetry logging for this
stream.
typedef void (*smtpverbose_t) (char *buffer);
buffer pointer to verbose reply buffer
This is the argument to the SET_SMTPVERBOSE mail_parmameter() call.
If this function pointer is non-NIL, then if a verbose SMTP response
(with SMTP code less than 100) is received, this function is called with
that response text as its argument.