Did you know ... | Search Documentation: |
Pack mail_merge -- prolog/mail_merge.pl |
This module provides a simple means to perform mail merge from a Prolog application: send personalized email message to a list of recipients. Here is a simple example:
mail_merge('Hello ~s how are you?',[['gianni@abc.com','Gianni'], ['stefi@cde.com','Stefi']], [subject('Hello'),from('Fabrizo'),auth(<google_user>-<google_password>)]).
smtp(+Host)
the name or ip address for smtp host, eg. swi-prolog.orgfrom(+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 headerauth(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
headermailed_by(By)
add X-Mailer: SWI-Prolog <version>, pack(smtp)
to header iff By is trueheader(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. host, port, security and auth_method are set by default to the values needed by gmail. If you use your gmail account you should just provide the option auth(<google_user>-<google_password>) You should also make sure that your google account has the option "Allow less secure apps" set to on. You can find the option in your account page under Apps with account access.