|
|
SMTPSTREAM *smtp_open(char **hostlist, long debug);
This function opens an SMTP connection to 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);
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);
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's
address->error
item.
void smtp_debug(SMTPSTREAM *stream);
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);
This function disables SMTP protocol telemetry logging for this stream.
typedef void (*smtpverbose_t)(char *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.