PublicShow sourcesmtp.pl -- Send E-mail through SMTP

This module provides a simple means to send E-mail from a Prolog application. Here is a simple example:

send_message(Out) :-
        format(Out, 'Hi Alice,\n\n', []),
        format(Out, 'Want to go out tonight?\n\n', []),
        format(Out, '\tCheers, Bob\n', []).


?- smtp_send_mail('alice@wonderland.com',
                  send_message,
                  [ subject('Tonight'),
                    from('bob@wonderland.com')
                  ]).

This library currently supports good old  SMTP, encrypted and authorized
ESMTP. Both SSL/TLS and STARTTLS  encryption is supported. Authorization
is supported using =PLAIN= and =LOGIN= methods.

Data is currently being sent using the =DATA= keyword.

@tbd    Support more advanced data transport extensions such as sending
        MIME messages.
Source smtp_send_mail(+To, :Goal, +Options)
Send mail using SMTP. To is the e-mail address of the receiver. Options:

Defaults are provided by settings associated to this module.

Listens to debug(smtp) which for instance reports failure to connect, (computation fails as per non-debug execution).

Arguments:
To- is an atom holding the target address
Goal- is called as call(Goal, Stream) and must provide the body of the message.