Did you know ... Search Documentation:
Predicate smtp_send_mail/3
 smtp_send_mail(+To, :Goal, +Options)
Send mail using SMTP. To is the e-mail address of the receiver. Options:
  • smtp(+Host) the name or ip address for smtp host, eg. swi-prolog.org
  • from(+FromAddress) atomic identifies sender address. Provides the default for header(from(From)).
  • date(+Date) Set the date header. Default is to use the current time.
  • subject(+Subject) atomic: text for 'Subject:' email header
  • auth(User-Password) authentication credentials, as atoms or strings.
  • auth_method(+PlainOrLoginOrNone) type of authentication. Default is default, alternatives are plain and login
  • security(Security) one of: none, ssl, tls, starttls
  • content_type(+ContentType) sets Content-Type header
  • mailed_by(By) add X-Mailer: SWI-Prolog <version>, pack(smtp) to header iff By == true
  • header(Name(Val)) add HName: Val to headers. HName is Name if Name's first letter is a capital, and it is Name after capitalising its first letter otherwise. For instance header(from('My name, me@server.org')) adds header "From: My name, my@server.org" and header('FOO'(bar)) adds "FOO: bar"

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.
 smtp_send_mail(+To, :Goal, +Options)
Send mail using SMTP. To is the e-mail address of the receiver. Options:
  • smtp(+Host) the name or ip address for smtp host, eg. swi-prolog.org
  • from(+FromAddress) atomic identifies sender address. Provides the default for header(from(From)).
  • date(+Date) Set the date header. Default is to use the current time.
  • subject(+Subject) atomic: text for 'Subject:' email header
  • auth(User-Password) authentication credentials, as atoms or strings.
  • auth_method(+PlainOrLoginOrNone) type of authentication. Default is default, alternatives are plain and login
  • security(Security) one of: none, ssl, tls, starttls
  • content_type(+ContentType) sets Content-Type header
  • mailed_by(By) add X-Mailer: SWI-Prolog <version>, pack(smtp) to header iff By == true
  • header(Name(Val)) add HName: Val to headers. HName is Name if Name's first letter is a capital, and it is Name after capitalising its first letter otherwise. For instance header(from('My name, me@server.org')) adds header "From: My name, my@server.org" and header('FOO'(bar)) adds "FOO: bar"

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.