WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Description: The active:sendmail service will send an email message via an SMTP gateway.
Identifier Syntax

sendmail is an accessor using Active URI syntax with the following base identifiers:


and the following arguments: (for more details on argument passing details see here)

Representation (java.lang.Object)SMTP configuration
Representation (java.lang.Object)The declarative specification of the email header
varargs [varargs] Any quantityRepresentation (java.lang.Object)Varargs allows an arbitrary number of additional unspecified arguments.
Request Verbs

The following verb is supported:


The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use sendmail accessor you must import the module urn:org:netkernel:email:core:


When a request with the SOURCE verb is issued to active:sendmail an SMTP protocol request is made to the SMTP server specified in the optional config argument to send an email specified in the required header argument. The body will comprise one or more body parts, each of which is identified by one or more additional arguments. At least one additional body-part argument is required.

The declarative specification of the email header.

  <subject>Some Subject</subject>
    <!--optional see below--></multipartSubType>


Specifies an additional attribute on the content-type when posting multipart messages. This value is used on the MultiPartMessage constructor for all parts. According to the javadoc...

"Some messaging systems provide different subtypes of Multiparts. For example, MIME specifies a set of subtypes that include "alternative", "mixed", "related", "parallel", "signed", etc."

"An application can directly construct a MIME multipart object of any subtype by using the MimeMultipart(String subtype) constructor. For example, to create a "multipart/alternative" object, use new MimeMultipart("alternative")"

So to post a message with both text/plain and text/html parts you'd want to ensure /email/multipartSubType==alternative - so that the mail client would recognise them as alternates and render the preferred form.


  <ssl /> or
  <tls />

The resource res:/etc/SMTPConfig.xml will be requested if the optional config argument is not provided.

Email Body Parts

All additional arguments are processed as MIME message parts of a multipart message and are added to the message. Each body part resource is requested as a IReadableBinaryStreamRepresentation representation.

If there exists an attachment declaration in the header with name corresponding to the argument then the filename in the message of the attachment is taken from the attachment declarations filename field.