http://www.zorba-xquery.com/modules/email/smtp

View as XML or JSON.

This module can be used for sending emails. The SMTP module contains only one public function that receives two parameters. The SMTP server access information passed as an hostInfo element and the email message representation as a message element. For a quick start see the examples associates with the send(...) function. For a complete specification read, the description and the documentation associated with this function.

Function Summary

send ($host-info as element(email:hostInfo), $message as element(email:message)) as empty-sequence()

This function sends an email message from the specified account.

Functions

send#2

declare  %an:sequential function smtp:send($host-info as element(email:hostInfo), $message as element(email:message)) as empty-sequence()
This function sends an email message from the specified account. The hostName child element of $host-info must have the form: remote_system_name [":" port] [flags]. This syntax is part of the Remote names syntax defined in the UW IMAP toolkit. The remote_system_name and flags fragments are explained in the section III of this document. For example the hostName could look like:
  • <hostName>smtp.gmail.com:587/tls/novalidate-cert<hostName>
  • <hostName>[209.85.129.111]:587/tls/novalidate-cert<hostName>
The $host-info parameter could then look like this:
 <hostInfo>
   <hostName>smtp.gmail.com:587/tls/novalidate-cert</hostName>
   <userName>username</userName>
   <password>password</password>
 </hostInfo>
 
For a complete of the structure of an email message, see the imported email schema: http://www.zorba-xquery.com/modules/email All the data passed to this function does not need to be validated. The only requirement is that they have a valid format and are in the correct namespace according to the schema: http://www.zorba-xquery.com/modules/email.

Parameters

host-info as element(email:hostInfo)
The SMTP host, user name, and password.
message as element(email:message)
The message to send as defined in the email XML schema.

Returns

empty-sequence()
The function is declared as sequential and has side-effects. It returns the empty sequence.